Konversi file ke base64 python
import base64
data = open("sample.txt", "r").read()
encoded = base64.b64encode(data)
MitchAloha
import base64
data = open("sample.txt", "r").read()
encoded = base64.b64encode(data)
import base64
with open("yourfile.ext", "rb") as image_file:
encoded_string = base64.b64encode(image_file.read())