Flash interprets 3xx redirect responses as errors.
Hi I am trying to upload videos to the YouTube API, it used to work great, butsomething has changed and now Flash interprets 3xx redirect responses as errors!
I found a post on another forum where somebody has commented on the issue much better than i can, but there is still no answer
Help please? I think this is an actual BUG in flash though...
[ANOTHER GUYS QUESTION]
Please help us to solve the following issue:
We are uploading a video to YouTube using the FileReference.upload()
method in AS3/Flex. When it finishes, YouTube sends a status 302,
which causes FileReference to trigger an IOErrorEvent. ResponseURL
parameter is empty with no any data to extract. Of course, we expect
here status 200 and after some tests we noticed the problem is
connected with versions of Flash Player.
We tested on next versions and:
10.0.42.34 worked (received status 200)
10.0.42.45 didn't work (received status 302)
10.1.53.64 didn't work (received status 302)
Also we found some older post from July 7, 2009 on
http://blog.curiousmedia.com/?q=blog/upload-youtube-flash which
describes the same problem in section "The Mac problem" but with no
correct solution.
Something similar about status 302 was said and for Youtube API for
Python where the one should set ssl param to False to receive correct
status back, but we are not sure how this can be implemented in
context of flash. Here is the post about it:
http://stackoverflow.com/questions/2863785/gdata-youtube-api-302-the-...
We tried to search alot all over the internet and Youtube's Docs, but
there is no any mention about the solution for this problem.
Thanks for any reply in advance!
[YOUTUBES ANSWER]
Hi there,
I ran the example you are referring to and I'm getting 302, as expected
since it is basically utilizing the browser-based uploading mechanism which
triggers a redirect.
From AS3 documentation I gather that, ioError event always follows
httpStatus event :
http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/n...
and this is what I see while running the uploader in Flex 10.x plugin :
[HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false
eventPhase=2 status=302 responseURL=null]
[IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2
text="Error #2038: File I/O Error. URL:
http://uploads.gdata.youtube.com/action/FormDataUpload/AIwbFARxu-IiTy...
"]
The file does get uploaded to YouTube, as expected. However, it looks like
Flash interprets 3xx redirect responses as errors.
The challenge of coming up with a better solution is related to limitations
of flash.net.FileReference, currently it does not allow one to set custom
request headers in Flash (from docs I gather that it is possible in Adobe
Air though) to implement, for example, resumable uploads.
Thanks,
Jarek Wilkiewicz, YouTube API Team
Any ideas gurus????
Cheers
