© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•2y ago•
16 replies
f3bruary

Uploaded images get octet-stream mime type

I'm new to Supabase and I'm trying to upload an image. The uploading works fine, and I can display images as well.

I noticed in the Dashboard, the image uploaded has the wrong mime-type. How do I correct this?

Although uploading is working, I would like to restrict the bucket to specific mime types. I did that, and now uploading doesn't work at all. Presumably because the server is not sending the correct mime-type?

// Upload banner to Supabase
const { data, error } = await supabase.storage
    .from("images")
    .upload(
        `profiles/UUID/${banner.name}`,
        banner,
        {
            upsert: true,
            // contentType: `image/${extension}`,
        },
    );
if (error) {
    console.log(error);
} else {
    console.log(data);
}
// Upload banner to Supabase
const { data, error } = await supabase.storage
    .from("images")
    .upload(
        `profiles/UUID/${banner.name}`,
        banner,
        {
            upsert: true,
            // contentType: `image/${extension}`,
        },
    );
if (error) {
    console.log(error);
} else {
    console.log(data);
}


If I uncomment that contentType line, it still doesn't pass the correct mime type.
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

Strip EXIF from uploaded images in Storage
SupabaseSSupabase / help-and-questions
4y ago
"Mime type not supported" error for jpeg files
SupabaseSSupabase / help-and-questions
3y ago
get Stream of current user
SupabaseSSupabase / help-and-questions
4y ago
Loading module from “localhost” was blocked because of a disallowed MIME type (“text-html”).
SupabaseSSupabase / help-and-questions
4y ago