© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•5mo ago•
28 replies
Jacob

Upload file to bucket with metadata from client side

Hey everyone!
I'm using the JavaScript library with Supabase client to upload/list/download files from client side. I would like to store custom metadata like the real filename.
Currently I upload like:

const { data, error } = await supabase.storage
  .from('bucket')
  .upload('path/file.txt', file, {
    metadata: { filename: 'My Real Filename.txt' }
  });
const { data, error } = await supabase.storage
  .from('bucket')
  .upload('path/file.txt', file, {
    metadata: { filename: 'My Real Filename.txt' }
  });


But when I list files, the metadata only shows system fields (eTag, size, mimetype), not my custom filename:

const { data } = await supabase.storage.from('bucket').list('folder');
console.log(data[0].metadata); // Only system metadata, no custom fields
const { data } = await supabase.storage.from('bucket').list('folder');
console.log(data[0].metadata); // Only system metadata, no custom fields


How do I retrieve the custom metadata I uploaded? Is there a getMetadata() method or different approach needed?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Upload file with french accent to bucket
SupabaseSSupabase / help-and-questions
3mo ago
bucket metadata
SupabaseSSupabase / help-and-questions
4y ago
How to upload file to storage with custom metadata?
SupabaseSSupabase / help-and-questions
3y ago
upload file to local storage bucket with service key
SupabaseSSupabase / help-and-questions
5mo ago