Can any one explain what is the advantage of Base64
as well Multipart
I know Multipart is faster then
Base64
...
But still many developers are using Base64...I studied both documentation but i am not clear
cases, binary multipart/form-data data is encoded as base64.
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.
Base64 image representation can be directly placed within html to render an image. Binary takes up less space. And benefits from greater network effects and standardization. E.g. if you want to use amazon simple secure storage S3 you have to store a binary file.
Difference between ASCII and base64When you encode text in ASCII, you start with a text string and convert it to a sequence of bytes. When you encode data in Base64, you start with a sequence of bytes and convert it to a text string.
Base64
Base64 is a way to encode binary data into an ASCII character format by translating it into a radix-64 representation.
I recommend you that never use Base64 for large file/data upload to server beacuse it's convert whole data and post it to server.
Multipart
Multipart is a way to upload file/data to server in the form of part which are in bytes. Multpart/form-data is applied to a form though, so you can send everything in a multi-part form, including "regular" data also.
Multipart ist a part of the http protocol. See
https://stackoverflow.com/a/19712083/5694629
Base64 is a way to convert arbitrary content into a serializable form for transmission.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With