How does the Base64 feature, as commonly observed in tasks like FilePicker and media uploads work?
Base64 is a method for encoding text format into a binary data, making it easier to transmit data over protocols that can handle only texts
Working of Base64 :
- It divides the data into each group of 3 bytes (24 bits).
- Then these 3 bytes further divide into groups of 6 bits and are mapped to ASCII characters.
- Finally, the ASCII characters resulting from each 6-bit chunk are concatenated together to form the Base64-encoded string.
Base64 encoding is used in serialization formats like JSON or XML to represent binary data in a text-based format.
When using functionalities like File Picker or Media Upload, Base64 encoding might be employed to ensure that the binary data of the selected file can be transmitted or sorted in a text-based format.
Once transmitted or received, the base64 encoded data can be decoded into its original binary format.