Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top