Skip to content

How to convert <streamsync.core.BytesWrapper object at 0x1065ca890> to base64 #274

Closed Answered by ramedina86
ManishAradwad asked this question in Q&A
Discussion options

You must be logged in to vote

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 and data. The latter is a file-like object.

I've pasted it here for your convenience:

def onchange_handler(state, payload):

	# An array of dictionaries is provided in the payload
	# The dictionaries have the properties name, type and data
    # The data property is a file-like object

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ManishAradwad
Comment options

@ManishAradwad
Comment options

@ramedina86
Comment options

Answer selected by ManishAradwad
@ManishAradwad
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #273 on March 01, 2024 14:54.