3
votes

I am trying to post an image to my own profile using the ActionScript SDK.

I have verified that i have the publish_stream and user_photos permissions.

I am logged in and can read Albums and Images.

Using this code:

var bitmap:Bitmap = new Bitmap(bitmapData);
var request:Object = new Object();
request.access_token = Facebook.getSession().accessToken;
request.message = "my message";
request.image = bitmap;
request.fileName = "filename.jpg";
meFacebook.api("/me/photos", postImageToUserCallback, request, URLRequestMethod.POST);

i always see the request failing with a

Error #2032: Stream Error. URL: https://graph.facebook.com/me/photos

I am totally stuck here. What could be the problem and how can i debug this the best way?

Thanks!

2
ok, here's an update: i am now using this guy's approach of just creating a multipart request forum.developers.facebook.net/viewtopic.php?id=58690 but it is still quite unsatisfying that i can't just use the sdk i am using anyway. so any help is still appreciated.DasAntonym

2 Answers

2
votes

I do this without issue, but with a couple of differences which may or may not make a difference:

Facebook.api(albumID+"/photos",onImagePost,{message:"",image:new Bitmap(myBmd), fileName:''},URLRequestMethod.POST);
  1. I use Facebook.api. What does your meFacebook wrapper do?
  2. I use an album ID rather than me
  3. fileName is an empty string.
0
votes

I had the exact same error below and it turned out that a link in the "message" parameter was causing the issue.

Error #2032: Stream Error. URL: https://graph.facebook.com/me/photos

We were using a vanity URL (from tinyurl) in the message body. After trying just about everything else, I removed the vanity URL and replaced it with the actual URL and the photo posted with no issues.

And I have no problem creating an album for the app. Facebook automatically creates one if it doesn't exist.

I am using ver 1.8.1 SWC from http://code.google.com/p/facebook-actionscript-api/

This is the code I am using:

var params : Object = {image:bitmap, 'My Message https://www.facebook.com/client?sk=app_##########', fileName:'my_filename.jpg'};
Facebook.api('me/photos', onSaveToPhotoAlbumComplete, params);