Question

I have code that will post a photo:

$ret_obj = $facebook->api('/me/photos', 'post', array(
                'message' => 'Test Image... please ignore. This should be deleted shortly.',
                'source' => '@/path/image.png'
));

Works well, however, I want to be able to include multiple images in a post. If you go to facebook's page and make a post, they give you the option with "Choose a file to upload". This allows you to upload a photo with your post. Then you can click on the empty image next to your photo and upload a second photo. You can include multiple photos this way using the FB UI.

I want to be able to do that via the api. Single post, multiple photos attached. I've checked numerous SO posts as well as google (I even looked at more than the first page) but cannot find the solution.

I thought to maybe "add" photos to the post after the original but don't see code to do that (and my understanding is that the api disallows editing).

I thought to create an album, upload photos to that and include that in the post, but don't see code to include the album in the post such that the images would appear with the post.

Any help would be great. Thank you!

Was it helpful?

Solution

As of now, Facebook graph does not allow this functionality. While you can batch your uploads, you can only upload a single image to a post whereas the Facebook web and mobile interfaces allow you to upload multiple images to a single post.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top