Skip to content

Support XMLHttpRequest file upload? #21

Closed
samfriend opened this Issue Jun 6, 2011 · 8 comments

5 participants

@samfriend

Hi

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."

http://onehub.com/blog/posts/designing-an-html5-drag-drop-file-uploader-using-sinatra-and-jquery-part-1/

Thx
Andrey

@vkholodkov
Owner

Sounds like a good idea. Could you write me a mail to valery+nginx@grid.net.ru?

@dmitry-dedukhin

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

@vkholodkov
Owner

Please write me a mail to valery+nginx@grid.net.ru as well

@garnieretienne

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
@dmitry-dedukhin

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 http://www.grid.net.ru/nginx/resumable_uploads.en.html

@garnieretienne

Oh thanx i will try that way !

@lincolndbryant

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?

Thanks

@vkholodkov
Owner

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.