Title: ActionScript Graph API: Posting Image To Facebook User Profile fails with Stream Error
Tags: apache-flex;actionscript-3;facebook-graph-api
Question: 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!
Comment: ok, here's an update: i am now using this guy's approach of just creating a multipart request http://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.

Here is the accepted answer: 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);
I use Facebook.api.  What does your meFacebook wrapper do?
I use an album ID rather than me
fileName is an empty string.
Comment for this answer: I certainly tried! http://stackoverflow.com/questions/6611685/posting-image-to-facebook-album-with-as3-api
Comment for this answer: While it did post, I found the Facebook did not create an album for me, and instead targeted the first app-created album that already existed.
Comment for this answer: that's the weird thing, i tried it with the "me" alias and also with an explicit user id. i also tried it with and without a filename, but no difference. the reason i send it to the user profile instead of an album is because i want the images to land in album created for the app, which is what facebook does automatically when you send it to the profile. did you ever try it that way with the sdk and were successful? as i said, it works when i construct a multipart form request and send it there myself.
Comment for this answer: that is exactly what i am experiencing now. the weird thing is, some users get it posted properly into an album named after the app and others say it lands in the first. if you only have a profile images album, your profile image actually gets changed. very unpleasant. so i am going to create an album and post it like you already figured out in your post. thanks for the help!

Here is another answer: 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);

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 1, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2011:00:08/07/11', 'FavoriteCount': 1.0, 'PostTypeId': 1, 'Tags': '<apache-flex><actionscript-3><facebook-graph-api>', 'Title': 'ActionScript Graph API: Posting Image To Facebook User Profile fails with Stream Error', 'ViewCount': 2207, 'id': 6973905, 'user_AboutMe': '', 'user_AccountId': 282214.0, 'user_DisplayName': 'DasAntonym', 'user_Reputation': 452.0, 'user_Views': 52.0, 'user_id': 578963.0}}