Skip to content

Support XMLHttpRequest file upload? #21

samfriend opened this Issue Jun 6, 2011 · 8 comments

5 participants



HTML5 does support file uploading using xmlhttprequest, which will post the raw content of file in POST body. I wonder if upload module can also support this new kind of file uploading method.

Just like this example here, but he didnt mention anything on how to modify upload module to accept PUT method.

"For our part, we’ve made some modifications to the venerable nginx upload module, allowing it to also accept PUT requests with raw file contents in the body."



Sounds like a good idea. Could you write me a mail to


Valery, this feature (support for PUT method) can be very helpfull for us too, especially in combination with resumable uploads...


Please write me a mail to as well


I also the idea like a support for PUT method with raw file content :) This can be usefull for Ajax file upload !

@samfriend samfriend closed this Jun 9, 2011

garnieretienne, you can use POST method for ajax upload, we are successfully using it about 6 months.
You can use either ordinary upload method with multipart/form-data POST, or resumable upload sending row file content and some extra headers


Oh thanx i will try that way !


Valery - great plugin we are also using it for production in front on Django.

When i try XHR uploads I get a 415 (Unsupported Media Type). I believe this is the post that is determining weather the endpoint supports the upload and has Access-Control-Origin headers to allow it. Do I need to somehow override the nginx 415 error page to add headers that enable xhr uploads?



Perhaps you don't have upload_resumable on set?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.