I'm trying to upload a photo on Facebook using Javascript SDK.In particular I generate a base64 encoded bytearray from my Actionscript3 app, I pass it to Javascript file using ExternalInterface, and from that I decode the bytearray and I try to upload to FB. But it give me this error:

{"error":{"message":"(#324) Requires upload file","type":"OAuthException","code":324}}I tried to upload an image simply from url, and in that way it goes well!
This is my Javascript code:

upPhoto:function(photo) { var img = F.decode_base64(photo); FB.api('/me/photos', 'post', { message:'test', fileName:'test', image: img }, function(response){ if (!response || response.error) { log('Error!'); } else { log('Upload OK!'); } }); } decode_base64:function(s) { var e={},i,k,v=[],r='',w=String.fromCharCode; var n=[[65,91],[97,123],[48,58],[47,48],[43,44]]; for(z in n){for(i=n[z][0];i