Hi all,
I'm working on a C# winform application to upload images to existing albums in Facebook. I can login/out successfully. Can get the available albums and their IDs. But when I upload photo, it gives this error - (
OAuthException - #200) (#200) Permissions error on fb.Post() method.
Please help me to figure this out.
Thanks
var fb = new FacebookClient(_accessToken);
string photoAlbumID = lstBoxAlbums.SelectedValue.ToString();
string temp = lstBoxAlbums.SelectedItem.ToString();
FacebookMediaObject picToUpload =
new FacebookMediaObject
{
FileName = lblFolderPath.Text + "\\" + lstBoxPics.SelectedItem.ToString(),
ContentType = "image/jpg"
};
var bytes = System.IO.File.ReadAllBytes(picToUpload.FileName);
picToUpload.SetValue(bytes);
var postInfo = new Dictionary<string, object>();
postInfo.Add("message", "test photo");
postInfo.Add("@file.jpg", picToUpload);
postInfo.Add("access_token", _accessToken);
postInfo.Add("scope", "publish_actions");
postInfo.Add("name", "Picture No 1");
var fbResult = fb.Post("/" + photoAlbumID + "/photos", postInfo);
dynamic result = (IDictionary<string, object>)fbResult;
PS:
when log in I use these permissions.
private const string _ExtendedPermissionsNeeded = "email,offline_access,user_photos,photo_upload,publish_actions,publish_stream ";