Facebook unity sdk posting image filenotfound exception

I’m using unity 4.2 and facebook sdk 5.1 and have been facing troubles posting images to facebook through unity android.

I have used the Interactive console to do so. I get this error.

“You are trying to load data from a www stream which had the following error when downloading.”

java.io.FileNotFoundException: https://graph.facebook.com/me/photos

Any suggestions would be appreciated.

I had the same problem… Turned out I was using a field that is not supported. I was adding the ‘link’ field and I got the java.io.FileNotFoundException. When I removed this field, it worked OK.

See code with the field commented out:

var wwwForm = new WWWForm();
wwwForm.AddBinaryData("image", texture, "photo.png");
wwwForm.AddField("message", message);
//wwwForm.AddField("link", "http://test.com");                 
FB.API("me/photos", Facebook.HttpMethod.POST, postPhotoCallback, wwwForm);

When you have installed the facebook unity plugin, there will be an Examples-directory added to your project. That contains all the basic functionality, including uploading photos. That is a good starting point.