What I’m trying to do:
I am trying to upload a image using a Uppy.io widget.
What I’ve tried and what’s not working:
Uppy returns an object like this:
{
"source": "Dashboard",
"id": "uppy-image/png-1e-image/png-8840-1694452544369",
"name": "image.png",
"extension": "png",
"meta": {"relativePath": None, "name": "image.png", "type": "image/png"},
"type": "image/png",
"data": <File proxyobject>,
"progress": {
"percentage": 0,
"bytesUploaded": 0,
"bytesTotal": 8840,
"uploadComplete": False,
"uploadStarted": None,
},
"size": 8840,
"isRemote": False,
"remote": "",
"preview": "blob:http://localhost:3032/262b526e-4c5e-4752-bb77-b31791e126fa",
}
How can I convert this object to BlobMedia in order to upload it server?
Trying this
blob = anvil.BlobMedia(content_type=file.type, content=file.data, name=file.name)
But got this message: content must be a byte-string, not File
I’ll prepare a sample app if necessary.