App Finishers

Fix guide · updated 2026-11-16

Supabase Storage "mime type … is not supported"

{"statusCode":"415","error":"invalid_mime_type","message":"mime type text/plain;charset=UTF-8 is not supported","code":"InvalidMimeType"}

An upload fails with "mime type text/plain;charset=UTF-8 is not supported", or with application/octet-stream, image/heic or image/webp in the middle. The bucket only accepts certain file types, and the type your upload declared isn't one of them. Often the picture is fine and only its label is wrong. We tested every case with the real supabase-js storage client (version 2.119) against Supabase Storage itself (version 1.95, November 2026).

What the error means

A bucket can have a list of allowed file types. When it does, Storage compares the type the upload declares with that list and refuses anything else, with HTTP 400 and "statusCode":"415" in the body. It reads the label, not the file's content. The type in the message tells you which case you're in:

The one-minute check

In the SQL Editor, run:

select id, allowed_mime_types from storage.buckets;

Empty means the bucket takes any type. Otherwise, compare the list with the type in your error message.

1. "text/plain;charset=UTF-8": raw data without a contentType

Your code uploads a string, an ArrayBuffer or decoded base64, which is common in React Native and Expo apps and when an app converts an image by hand. For that kind of data, supabase-js can't know the type, so it sends its default, text/plain;charset=UTF-8. Its own documentation says to pass contentType whenever the data isn't a Blob, File or FormData:

const { error } = await supabase.storage
  .from('images')
  .upload(path, arrayBuffer, { contentType: 'image/png' })

In our test, the same upload failed without contentType and went through with it.

2. "application/octet-stream": a Blob or File without a type

For a Blob or a File, supabase-js sends the type stored in the object itself and ignores the contentType option. In our test, an untyped Blob uploaded with contentType: 'image/png' still went out as application/octet-stream and was refused. Give the object its type instead:

const blob = new Blob([data], { type: 'image/png' })
// or, from an existing blob: new File([oldBlob], 'photo.png', { type: 'image/png' })
const { error } = await supabase.storage.from('images').upload(path, blob)

A Blob built from raw bytes has no type unless you give it one. A File picked in the browser gets its type from the file name, and an extension the browser doesn't recognize leaves it empty too.

3. A real type that isn't on the list

The file declares a correct type, but the bucket doesn't allow it. The usual ones:

To accept more, edit the bucket in Storage: under Restrict MIME types, add types to Allowed MIME types. A wildcard on the second half works, like image/* for every image type. Or in SQL:

update storage.buckets set allowed_mime_types = array['image/*'] where id = 'images';

Keep a list if it fits your app, but don't count on it for security: it checks the type the upload claims, not what the file really is.

If an AI tool built your app

Give your AI tool this prompt:

Find every supabase.storage upload. If the data is a string, an ArrayBuffer or decoded base64, pass contentType with its real type, for example 'image/png'. If it's a Blob, create it with its type: new Blob([data], { type: 'image/png' }). Use 'image/jpeg', never 'image/jpg'. Don't change anything else.

Changing the bucket's list (case 3) is a dashboard setting, so that part is yours.

Not quite your error?

Still stuck?

Open your browser's Network tab and click the failing upload. For raw data, the request's Content-Type header is the declared type. For a Blob or File, the request is a form and the type sits on the file part inside it. Whatever it says is what Storage compared with the bucket's list.

Other Supabase problems? See Supabase fixes.