© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•8mo ago•
41 replies
LittleCat

Corrupted File on upload

Hi! I am using supabase-js
"@supabase/supabase-js": "^2.50.0",
"@supabase/supabase-js": "^2.50.0",


I am facing an issue where every upload that I did contains this in the file header

------WebKitFormBoundaryq1P65x9Cx4VFT0SU
Content-Disposition: form-data; name="cacheControl"

3600
------WebKitFormBoundaryq1P65x9Cx4VFT0SU
Content-Disposition: form-data; name=""; filename="topsecret.txt"
Content-Type: application/octet-stream
------WebKitFormBoundaryq1P65x9Cx4VFT0SU
Content-Disposition: form-data; name="cacheControl"

3600
------WebKitFormBoundaryq1P65x9Cx4VFT0SU
Content-Disposition: form-data; name=""; filename="topsecret.txt"
Content-Type: application/octet-stream


When uploading via the dashboard, the file uploads fine. When uploading via the JS SDK, the header get inserted to every file happens. Here are my code snippets


const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
        const selectedFiles = event.target.files;
        if (selectedFiles && selectedFiles.length > 0) {
            const file = event.target.files?.[0]
            if(file != null){
                supabase.storage.from("bucket-name").upload(`users/abc/testUpload/${file?.name}`, file, {
                    upsert: true,
                    contentType: "text/plain"
                }).then(file => {
                    console.log(file.data)
                })
            }   
        }
    };
const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
        const selectedFiles = event.target.files;
        if (selectedFiles && selectedFiles.length > 0) {
            const file = event.target.files?.[0]
            if(file != null){
                supabase.storage.from("bucket-name").upload(`users/abc/testUpload/${file?.name}`, file, {
                    upsert: true,
                    contentType: "text/plain"
                }).then(file => {
                    console.log(file.data)
                })
            }   
        }
    };

I did have a browse through the issue tracker(https://github.com/supabase/supabase/issues/36929) and this seems related? Anyone facing the same issue?
GitHub
[Bug] Storage in sa-east-1: Successful PNG uploads are being served...
Bug report Hello, I&#39;m experiencing a critical bug with Supabase Storage in my project. Project Ref: gnmxihdaawlenwspsxum Region: sa-east-1 Problem: When I upload a valid PNG file (e.g., ~745KB)...
[Bug] Storage in sa-east-1: Successful PNG uploads are being served...
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
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

file upload
SupabaseSSupabase / help-and-questions
4y ago
Cannot upload file
SupabaseSSupabase / help-and-questions
6mo ago
Clear out file metadata on upload to storage?
SupabaseSSupabase / help-and-questions
3y ago
Multithread Storage file upload limits ?
SupabaseSSupabase / help-and-questions
5mo ago