Skip to content

id does not exists on storage UploadResponse #1111

Closed
@softmarshmallow

Description

@softmarshmallow

While JS (document does not state it) responses with id from uploaded object,

https://supabase.com/docs/reference/javascript/storage-from-upload

Python does not. I am using supabase py for automated bucket upload, and need a id for further processing.

AttributeError: 'UploadResponse' object has no attribute 'id'
Image

Current workaround 🥲

            res = supabase.storage.from_(BUCKET_NAME).upload(
                path, fdata, {"content-type": content_type, "x-upsert": "true"})

            ref = supabase.storage.from_(BUCKET_NAME).list(
                "",
                {
                    "limit": 1,
                    "offset": 0,
                    "sortBy": {"column": "name", "order": "desc"},
                    "search": res.path,
                }
            )

        # ref.id

Metadata

Metadata

Assignees

Labels

invalidThis doesn't seem right

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions