views:

357

answers:

1

I need to build a file uploader in AS3 that is capable of uploading files into an authenticated django view which contains a form with a file upload input.

I have been working on this for an entire 7 days, all day.

After much digging, I have discovered that Adobe, in their infinite wisdom has disabled cookie headers from being sent from flash. By default, django only accepts sessionid's via cookie, so I added a custom middleware that allows authentication via a sessionid POST var. This has been tested, and is functional.

However, I still cannot upload, even with the sessionid in the POST. When I do attempt an upload, the bytes seem to go up, and then for some reason, the upload fails. Here is said response.

flash says selectHandler: name=douchetop.png URL=http://dev.citizengroove.com/upload/
progressHandler: name=douchetop.png bytesLoaded=32768 bytesTotal=139082
progressHandler: name=douchetop.png bytesLoaded=65536 bytesTotal=139082
progressHandler: name=douchetop.png bytesLoaded=98304 bytesTotal=139082
progressHandler: name=douchetop.png bytesLoaded=131072 bytesTotal=139082
progressHandler: name=douchetop.png bytesLoaded=139082 bytesTotal=139082
httpResponseStatusHandler: [HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2 status=500]
httpStatusHandler: [HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2 status=500]
flash says: ioErrorHandler: Error #2038: File I/O Error. URL: http://dev.citizengroove.com/upload/

Please, please, please help me!

A: 

I'm not sure what the problem is, but I might be able to give you some advice to help you work through this.

Have you tried uploading the file via curl?

curl http://dev.citizengroove.com/upload/ -d <Post Data> -T douchetop.png

Then, based on what that hands back to you, you might be able to debug this easier assuming that the problem is within django and not flash. If nothing else you will know which half of this is having the problem.

emeryc