I’m implementing the Facebook batch process to upload multiple images with the single request.
I’m using the simple example given at:
And my code is as follow:
$str = "curl
–F ‘access_token=…’ \
-F ‘batch=[{
“method”:”POST”, \
“relative_url”:”ALBUM_ID/photos”, \
“body”:”message=My photo” \
"attached_files":"file1" \
},
{
“method”:”POST”, \
“relative_url”:”ALBUM_ID/photos”, \
“body”:”message=My photo” \
"attached_files":"file2" \
},
{
“method”:”POST”, \
“relative_url”:”ALBUM_ID/photos”, \
“body”:”message=My photo” \
"attached_files":"file3" \
},
]’
-F ‘file1=@3.jpg’ \
-F 'file2=@2.jpg' \
-F 'file3=@1.jpg' \
https://graph.facebook.com "
exec($str, $error);
And when I check my $error variable it shows me that "curl: -F not found".
And if I echo that string on browser and then copy / past on terminal does work for me.
I’m not getting why this is not working with PHP.
Thanks!
ok, try to do following:
This should work..