1 <?php 2 error_reporting(E_ALL); 3 header('content-type: image/jpeg'); 4 require_once ('soapclient/SforcePartnerClient.php'); 5 require_once('connection.php'); 6 7 getPhotos($_GET['id']); 8 9 10 function getPhotos($id){ 11 $mySforceConnection = getConnection(); 12 $query = "SELECT Id, Name, Body from Attachment Where Id ='" .$id ."'"; 13 $queryResult = $mySforceConnection->query($query); 14 15 $records = $queryResult->records; 16 17 print_r(base64_decode($records[0]->fields->Body)); 18 return NULL; 19 } 20 21 ?>