1
$facebook->setFileUploadSupport(true); 


//Create an album 
$album_details = array(
     'message'=> 'How will you die?', 
     'name'=> 'How will you die?' 
); 
$create_album = $facebook->api('/me/albums', 'post', $album_details); 

//Get album ID of the album you've just created 
$album_uid = $create_album['id']; 

//Upload a photo to album of ID... 

$file='img/'.$fbid.'.jpg'; //Example image file 

$photo_details = array('message'=> 'Find...51', 'image' => '@'.realpath($file)); 
$upload_photo = $facebook->api('/'.$album_uid.'/photos', 'post', $photo_details); 

$upphoto = $upload_photo['id']; 
print_r ($upphoto); 


ImageDestroy($canvas); 

header("Location: http://www.facebook.com/" . urlencode($fbid) . "&photoid=" . urlencode($upload_photo['id'])); 

我使用此代碼創建一個相冊,並上傳用戶的照片上的Facebook個人資料與Facebook的幫助應用程序。但同樣和aain,多次我得到三(3)錯誤imagejpeg()[function.imagejpeg]:無法打開「IMG/100001326588945.jpg」寫

  1. 警告:imagejpeg()[function.imagejpeg]:無法打開 'IMG/100001326588945.jpg' 寫作:沒有這樣的文件或目錄in /home/a2424901/public_html/index.php on line 58

  2. curl_setopt_array()[function.curl-setopt-array]:有效的open_basedir限制。文件()不在以下路徑中:/(/ home /:/ usr/lib/php:/ tmp)在802線上的012h未捕獲的CurlException:3:未設置URL!拋出/home/a2424901/public_html/base_facebook.php線814

Here is the base_facebook.php code

謝謝!

+0

怎樣才能幫助?您錯過了導致錯誤的部分代碼。 – Brad

+1

不僅如此,錯誤信息非常直截了當。比什麼更簡單:文件不在那裏? –

回答

0

試圖把不是把絕對路徑的相對路徑,至少這是我如何解決這個問題。