Skip to content

Can't upload metadata when uploading a file #1668

@shaaandi

Description

@shaaandi

Trying to upload some meta-data along with uploading the file and it's not working.

I am doing this

supabase.storage.from('bucket-name').upload('some-file-anme', file, {
  metadata: { ...some data }
})

I have also tried

    const fileBody = new FormData();
    fileBody.append('metadata', JSON.stringify({ name: 'data' }));
    fileBody.append('', file);
    supabase.storage.from('bucket-name').upload('some-file-anme', fileBody )

I see that it doesn't support any metadata type so please let me know how to add a metadata while uploading the file.
I need the metadata for some RLS policies later.

Thanks alot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstorage-jsRelated to the storage-js library.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions