How to handle HTTPStatus Response 201 with AS3 / Flash / SWFUpload
Posted
by Praveen Sharma
on Stack Overflow
See other posts from Stack Overflow
or by Praveen Sharma
Published on 2009-11-27T03:05:29Z
Indexed on
2010/05/26
15:21 UTC
Read the original article
Hit count: 399
Hey all.
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.
© Stack Overflow or respective owner