2

All the examples I've seen use the old $facebook->api for album and uploading an image.

ie, old api//$facebook->setFileUploadSupport(true);

What would the new api call be? FB->setFileUploadSupport(true);

Is there anyone that have an idea what the new methods are for creating album, and uploading an image to the album just created?

Any help?

  • 1
    Here is an awesome answer that someone posted on this very site not long ago... hope it helps.. but I cant take credit for the answer http://facebook.stackoverflow.com/a/3006867/558021 – Lix Jan 26 '12 at 21:52
  • You should try out the search feature on StackOverflow - many times others have also faced similar problems. – Lix Jan 26 '12 at 21:52
  • possible duplicate of [Upload Photo To Album with Facebook's Graph API](http://facebook.stackoverflow.com/questions/2718610/upload-photo-to-album-with-facebooks-graph-api) – DMCS Jan 26 '12 at 23:37
  • It is using $facebook->api, not the FB.api – Tyler Boyer Jan 27 '12 at 02:27

1 Answers1

0

You have to do two calls to facebook.

1) create an album 2) post to the recently created album

Scenario 1: A post request to /me/albums with access_token, name parameters will create an album

curl -F \ "access_token=..."  \ -F "name=name of album...." \ "https://graph.facebook.com/me/albums

This will return an album_id

Scenario 2: A post request to /album_id/photos with access_token, message, source

curl -F \ "access_token=..."  \ -F "message=..." \ -F "source=@/home/user/abc.jpg" "https://graph.facebook.com/album_id/photos
Devaroop
  • 7,900
  • 2
  • 37
  • 34