You can either create one album and upload to the album, otherwise you can upload to the default album of your app.
In order to publish a photo to a user’s album, you must have the
In order to publish a photo to a user’s album, you must have the
publish_stream
permission. With that granted, you can upload a photo by issuing an
HTTP POST request with the photo content and an optional description to
one these to Graph API connections:
-
https://graph.facebook.com/USER_ID/photos
- The photo will be published to an album created for your app. We automatically create an album for your app if it does not already exist. All photos uploaded this way will then be added to this same album.
-
https://graph.facebook.com/ALBUM_ID/photos
- The photo will be published to a specific, existing photo album, represented by the ALBUM_ID.
WebClient client = new WebClient();
client.UploadFile("https://graph.facebook.com/me/photos?access_token="
+ accessToken + "&message=" +
name, "POST", path);
upload to the particular album
WebClient client = new WebClient();
client.UploadFile("https://graph.facebook.com/" + albumID
+ "/photos?access_token=" +
accessToken + "&message=" +
name, "POST", path);
Thanks! I was trying to do this using the FacebookMediaObject and kept getting an unauthorized #324 error.
ReplyDeleteHoly cow i never thought it was so simple. this is the answer that i was looking for in ages. Thanks a lot
ReplyDeletewhen uploading like that, will it show on the user news-feed?
ReplyDeleteCould you please provide any sample solution?
ReplyDelete