xhr.send(file) doesn't post it as multipart

后端 未结 2 634
孤城傲影
孤城傲影 2021-01-07 11:22

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

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-07 11:53

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

提交回复
热议问题