Esp32 save as image from base64 string to SPIFFS

I have a base64 string as image (it come from server) , ı want to save image from base64 string to SPIFFS

İt is possible ?

Yes, it is possible to save an image to SPIFF's. SPIFFS, on the ESP32, has been depreciated. Use LittleFS; LittleFS_esp32 - Arduino Reference.

you'll need to decode the base64 message if you want to go back to the original data

Can you give me any example code ? for convert and save

there are base64 libraries with examples
there are SPIFFS or LittleFS examples

just put them both together

If you are able to send an image as text then you should be able to reverse the received text into an image.

If you can't figure out how to reassemble the text into an image then post the code of how you are disassembling the image into text so someone here might reverse the process for you.

The base64 code comes from the server, so we don't do the conversion, I want to save the incoming base64 code as an image.

Is there a library you recommend?

Not specifically

I've used in the past this one GitHub - Xander-Electronics/Base64: A Base64 library for Arduino but there are others in crypto packages.

the algorithm for decoding Base64 is pretty straightforward, so you could even implement that without a library. Some reading here: Base64 Encode and Decode in C

MIT has a simple version here in C that you could modify to avoid the malloc() (and it's not a best practice to rely on the caller to free up something that has been allocated in a function)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.