Apps / helper /image_helper.py
khaledeng15
add files
98ed57d
raw
history blame contribute delete
174 Bytes
import base64
def to_base64(uploaded_file):
file_buffer = uploaded_file.read()
b64 = base64.b64encode(file_buffer).decode()
return f"data:image/png;base64,{b64}"