How to convert <streamsync.core.BytesWrapper object at 0x1065ca890> to base64 #274
-
I'm taking an image as a user input and I want to convert it into base64. How can I do that? |
Beta Was this translation helpful? Give feedback.
Answered by
ramedina86
Mar 1, 2024
Replies: 1 comment 4 replies
-
Hi, what are you trying to do? How are you getting the image from the user? I believe you should only see |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ss.pack_bytes()
is meant to take some data from the backend and then serialise it so that it can be shown in the frontend. For example, if you have some bytes generated by AI. But taking input is different.Check out the stub from the File Input component (by clicking on the help icon next to the event handler in Builder).
You get an array of the uploaded files. Each element of that array is a dict with
name
anddata
. The latter is a file-like object.I've pasted it here for your convenience: