Take the 2-minute tour ×

I'm using SWFUpload on a Rails site to allow for MP3 Uploads direct to Sound Cloud. To avoid having to first upload a large file to my server and push to Sound Cloud, I'm hitting their API directly via SWFUpload, passing necessary OAuth token data.

Everything works - EXCEPT - Flash can't handle the HTTP response code that Sound Cloud's API returns (201). This ALWAYS triggers an unhandled IO Error with Flash. Even though SWFUpload allows me to override that in the JS, it breaks any response data (the URI to the uploaded file).

Does anyone know how I could somehow intercept the 201 code so that I can make it a 200 code for flash? I'm at a loss at how I can avoid this IO Error. I've tried try/catch statements around everything and have even recompiled SWFUpload to try new things to no avail. Any help would be greatly appreciated.

share|improve this question
There's a good chance you're screwed - Flash is monumentally bad at talking to REST services. –  Malcolm Box May 26 '10 at 15:18
Flash is bad at making an HTTP calls? Where did you learn this? –  Matt Jan 10 '12 at 3:18
add comment

2 Answers

up vote 1 down vote accepted

About the only thing you can do is capture it via an HTTPStatusEvent and then capture but ignore the IOError if the last HTTPStatusEvent was a 201. Unfortunately you can't actually read the response headers this way, but you can tell that it completed.

share|improve this answer
add comment

Unfortunately, you're screwed. It's not possible to handle any response codes other than 200 in Flex. Anything else results in an error.

share|improve this answer
I don't think this is true - actually Flex and AIR SDKs CAN handle response codes. Pure AS3 cannot... –  Praveen Sharma Nov 10 '10 at 4:29
add comment

Your Answer


