[英]PhotosDuplicateTagInBatch error when uploading / tagging photos in Facebook!
I am writing an application that allows users to upload multiple photos at once to facebook and it will automatically tag themselves (no one else) in the photo when this happens. 我正在编写一个应用程序,该应用程序允许用户一次将多张照片上传到Facebook,并在发生这种情况时自动在照片中标记自己(无其他人)。
If I run the script once, it works fine, if I try to upload and tag multiple photos then it complains with a PhotosDuplicateTagInBatch
error and I can't find ANY information as to why this is happening! 如果我运行脚本一次,则运行良好,如果我尝试上传并标记多张照片,则该
PhotosDuplicateTagInBatch
出现PhotosDuplicateTagInBatch
错误,并且找不到任何有关此情况的信息!
Here is my code: 这是我的代码:
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);
}
}
If I output my arguments they come out as: Code: 如果我输出参数,它们将显示为:代码:
Array
(
[message] => 4
[image] => @imagepathhere
[tags] => Array
(
[0] => {"tag_uid":"100002493436028","x":13,"y":68}
[1] => {"tag_uid":"100002493436028","x":60,"y":57}
)
)
So essentially, from what I can tell, you cannot upload and tag multiple photos like this. 所以从本质上讲,据我所知,您不能像这样上传和标记多张照片。 What I had to do was upload the photo, then tag it separately and rinse and repeat
我要做的就是上传照片,然后分别标记并冲洗并重复
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.