application/x-www-form-urlencoded or multipart/form-data?

前端 未结 6 1615
無奈伤痛
無奈伤痛 2020-11-21 06:35

In HTTP there are two ways to POST data: application/x-www-form-urlencoded and multipart/form-data. I understand that most browsers are only able t

6条回答
  •  深忆病人
    2020-11-21 07:17

    Just a little hint from my side for uploading HTML5 canvas image data:

    I am working on a project for a print-shop and had some problems due to uploading images to the server that came from an HTML5 canvas element. I was struggling for at least an hour and I did not get it to save the image correctly on my server.

    Once I set the contentType option of my jQuery ajax call to application/x-www-form-urlencoded everything went the right way and the base64-encoded data was interpreted correctly and successfully saved as an image.


    Maybe that helps someone!

提交回复
热议问题