2011-06-17 96 views
0

我正在編寫一個應用程序,允許用戶一次上傳多張照片到Facebook,並且在發生這種情況時,它會自動在照片中標記自己(沒有其他人)。PhotosDuplicateTagInBatch在Facebook上傳/標記照片時出現錯誤!

如果我運行腳本一次,它工作正常,如果我嘗試上傳和標記多張照片,然後它抱怨PhotosDuplicateTagInBatch錯誤,我無法找到任何信息,爲什麼發生這種情況!

這裏是我的代碼:

for ($i = 5; $i >= 1; $i--) 
    { 
     $img = GetImage($i); 
     $tag = array(
      'tag_uid' => $facebook->getUser(), 
      'x' => rand (0,100), 
      'y' => rand (0,100) 
     ); 
     $tags[] = json_encode($tag); 
     $args = array(
      'message' => $i, 
      'image' => '@'.realpath($img), 
      'tags' => $tags, 
     ); 

     $data = $facebook->api('/me/photos', 'post', $args); 
    } 

} 

如果我輸出我的論點,他們出來爲: 代碼:

Array 
(
    [message] => 4 
    [image] => @imagepathhere 
    [tags] => Array 
     (
      [0] => {"tag_uid":"100002493436028","x":13,"y":68} 
      [1] => {"tag_uid":"100002493436028","x":60,"y":57} 
     ) 

) 

回答

0

所以基本上,從我可以告訴,你不能上傳和標籤像這樣的多張照片。我必須做的是上傳照片,然後單獨標記並沖洗並重復