-
Notifications
You must be signed in to change notification settings - Fork 537
Open
Open
Copy link
Labels
enhancementNew feature or requestNew feature or request
Description
Description
I've searched in the documentation but I haven't found a way to set the Content-Encoding header when uploading files to Storage.
In our use case, we are storing in Supabase Storage big files that would compress nicely with gzip (compressed files are just ~10% of uncompressed size).
We upload these files from an Edge function and consume them in the browser.
If we could set the Content-Encoding we could save bandwidth and storage space by storing them compressed and then letting the browser ungzip the file when fetching it.
Suggested solution
const file = await Deno.open(localPath, { read: true });
const compressedStream = file.readable.pipeThrough(new CompressionStream('gzip'));
await supabase.storage
.from('my_bucket')
.upload(remotePath, compressedStream, {
contentType: 'application/octet-stream',
contentEncoding: 'gzip'
});Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request