Updated on 2023-10-19 GMT+08:00
How Do I Obtain the Base64 Code of an Image?
This section uses Python as an example to describe how to convert a local image into Base64 encoding. You can also use an online conversion tool.
Replace d:\demo.jpg in the code with the actual image path.
import base64 with open("d:\demo.jpg", "rb") as image_file: encoded_string = base64.b64encode(image_file.read()).decode() print(encoded_string)
Parent topic: APIs
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot