|
Hi, I am experiencing an issue where image files (specifically JPEGs in my tests) uploaded to Supabase Storage are being saved and subsequently served with the MIME type application/json, instead of their original type (image/jpeg). This happens even though the contentType option is correctly set during the upload using supabase-js. Steps to Reproduce:: MIME Type Restriction Test (Crucial Evidence): To enforce the correct type, I set the "Allowed MIME types" in the testimonial-images bucket settings to image/*. As I am relatively new to coding, it's possible I might have overlooked something specific in the configuration or documentation. However, I have reviewed the official Storage documentation and sought help from AI assistants, but haven't been able to identify any error in my implementation that would explain this behavior. Thank you for looking into this! |
Replies: 4 comments 2 replies
|
Same issue!! IMpossible to solve :( |
|
I ran into the same problem in my project too and found that in the supabase.ts file there was a global header set up as below
which was causing this issue. Try to find that if you some similar place where you can find this kind of configuration and just remove it. |
|
Hey @kunalkhin, I actually tracked the issue down to the exact same global 'Content-Type': 'application/json' header on my end too. Still, I really appreciate you taking the time to post the fix—sharing it here will save a lot of others some serious debugging hours. Thanks again for jumping in and helping out! 🙌 |
|
Ran into this also. This is how you fix this: Supabase Storage expects ArrayBuffer for binary uploads Exampe
Hope this helps! Amde me crazy to solve this ^^ |


I ran into the same problem in my project too and found that in the supabase.ts file there was a global header set up as below
export const supabase = createClient(supabaseUrl, supabaseAnonKey, { auth: { persistSession: true, autoRefreshToken: true, }, global: { headers: { 'Content-Type': 'application/json', }, },which was causing this issue. Try to find that if you some similar place where you can find this kind of configuration and just remove it.