Base64 image upload VS Binary image upload?

前端 未结 2 1019
难免孤独
难免孤独 2020-12-29 21:22

I want my mobile application to be able to upload an image to my server, in my case it\'s a Rails 3.2.11 with nginx.

I read alot ab

2条回答
  •  猫巷女王i
    2020-12-29 22:25

    Base64 converts your data to an ASCII representation of the binary data. It allows you to embed your data in text streams such as JSON for example. Base64 increases the size of the data transferred by 33%.

    multipart/form-data is the standard way of transferring binary data in HTTP requests. It allows you to use specific encodings / content types for each part you'd like to transfer. In my opinion, you should stick to multipart uploads unless you have specific requirements or device/SDK capabilities.

提交回复
热议问题