
yeah so I'm getting bytes back from the get_file_view, and get_file_download, I thought I would get back a URL as with the desktop client?

image_document = self.database.add_user_image(
image_request.image,
f"{image_request.userId}_{datetime.now().timestamp()}{file_extension}",
image_request.mimetype,
image_request.userId,
)
print(f"Uploaded image document ID: {image_document.get('$id')}") # type: ignore
file_url = self.database.storage.get_file_view(
image_request.userId,
image_document.get("$id"), # type: ignore
)
print(f"File: {json.dumps(file_url, indent=4)}")
I've gotten back (from each endpoint) bytes and Idk why, so
print(f"File: {json.dumps(file_url, indent=4)}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/__init__.py", line 238, in dumps
**kw).encode(obj)
^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/encoder.py", line 202, in encode
chunks = list(chunks)
^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/encoder.py", line 439, in _iterencode
o = _default(o)
^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/encoder.py", line 180, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type bytes is not JSON serializable

@Drake is this supposed to happen?

Or is the server SDK not meant to be used like this

cause I can't convert it to a string either

Only the web sdk gives a URL
Recommended threads
- Hola equipo de soporte,
Hola equipo de soporte, Estoy desarrollando una Function en Appwrite Cloud con Node.js 22 y el siguiente package.json: { "name": "upload-whitelist", "type"...
- [Node.js SDK] Bypass 2GB file limit?
Hello. Using either InputFile.fromPath or InputFile.fromBuffer throws this error: File size (2295467305) is greater than 2 GiB Bucket limit etc. is setup corre...
- Hi im using vvs studio to make a charact...
my game involves magic , leveling up aka "phase" max phase is 30 each 10 20 30 theres awakening 1 2 3 i want to make a character builder so that players can fig...
