You need to put the "batch" request in the Graph API. This is described here: https://developers.facebook.com/docs/reference/api/batch/ (see the paragraph “Downloading binary data”). Basically this is a cURL call in which you json encode an array containing all the "batch" requests ("batch = [json array of calls]"). For some good resonances, Facebook limits your array to 20 requests. This works very well for PHP cURL methods if you have cURL enabled on your server ...
curl –F 'access_token=…' \ -F 'batch=[{"method":"POST", \ "relative_url":"me/photos", \ "body":"message=My cat photo" \ "attached_files":"file1" \ }, {"method":"POST", \ "relative_url":"me/photos", \ "body":"message=My dog photo" \ "attached_files":"file2" \ }, ]' -F ' file1=@cat.gif ' \ -F ' file2=@dog.jpg ' \ https://graph.facebook.com
UPDATE: replace "by" and "by"
source share