Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Multipart/form-data? is it better than httpost with base64 encrypting while uploading images?

Tags:

android

Why or when should someone use Multipart/form-data?

the thing is I use to upload images to server with httpost base64 (random example) but I noticed while reading through volley I Can upload file with multipart/form-data ..

So when should I use consider to upload my images to server ? multipart or httpost base64

like image 955
Moudiz Avatar asked Jul 31 '15 08:07

Moudiz


People also ask

What is the difference between Base64 and multipart?

Base64-encoded data is approximately 33% larger, meaning longer upload times, more bandwidth used, and a lower maximum file size for non-multipart uploads. You can insert or update blob data using a non-multipart message, but you are limited to 50 MB of text data or 37.5 MB of base64–encoded data.

Does multipart form data use Base64?

It is worth noting though that in most (all?) cases, binary multipart/form-data data is encoded as base64.

Should I use multipart form data?

use multipart/form-data when your form includes any <input type="file"> elements. otherwise you can use multipart/form-data or application/x-www-form-urlencoded but application/x-www-form-urlencoded will be more efficient.

What is the benefit of having a message Base64 encoded?

Base64 encoding schemes are commonly used when there is a need to encode binary data that needs to be stored and transferred over media that are designed to deal with ASCII. This is to ensure that the data remain intact without modification during transport.


1 Answers

Multipart is multi part (duh).

So if you have a very large file the request will send it in multiple parts instead of inside a "regular" POST request. Since POST requests also have an upper limit, which now I don't remember but its not that much (a couple of megabytes) if you upload something huge you should use multipart-forms if you use http.

like image 106
breakline Avatar answered Sep 28 '22 07:09

breakline