views:

69

answers:

1

On Firefox 3.6 and Chrome, using xhr.send(file) just puts the raw contents into the body of the request and it is not a true multipart/form-data upload.

Tried doing this: http://kaply.com/weblog/2010/05/20/post-multipart-form-xhr/

But, can't really mix string with File contents during send().

Any workarounds?

+1  A: 

The key thing is using sendAsBinary(body) istead of send(body). See the last comment on the page you linked!

pongi