file_type_not_allowed API Origin: Application & API Last updated 14 Oct 2026

Upload error: File type not allowed / unsupported file type

The upload was rejected because the file’s type — extension, MIME type or actual content — isn’t on the allowed list.

Exact message you may see File type not allowedUnsupported file typeThe file must be a file of typenot allowed to upload this file typeInvalid file type
Seen on: REST API

Meaning

Upload endpoints check the extension, the declared Content-Type of the file part, and often the file’s real signature (magic bytes). A HEIC photo renamed .jpg, a PDF uploaded as application/octet-stream, or an SVG on an image-only endpoint all fail.

Laravel says “The file must be a file of type: jpg, png”, WordPress “Sorry, you are not allowed to upload this file type”, Multer-based APIs “Unsupported file type”. This is different from 415, which is about the request’s overall Content-Type.

Common causes

  • Format not supported (HEIC, WEBP, SVG, DOCX…)
  • Wrong MIME type on the file part (application/octet-stream)
  • Extension doesn’t match the real content
  • Endpoint allow-list stricter than expected

⚡ Quick fix

  1. Convert to an allowed format (JPEG/PNG/PDF)
  2. Set the correct MIME type on the file part
  3. Check the endpoint’s allowed types in the docs

Detailed fix by platform

Node.js

  1. javascript
    const form = new FormData();
    form.append('file', new Blob([buf], { type: 'image/png' }), 'photo.png');
    await fetch(url, { method: 'POST', body: form });   // let fetch set the multipart boundary

curl

  1. curl -F 'file=@photo.png;type=image/png' https://api.example.com/v1/uploads

How to diagnose

  1. Real type — file --mime-type photo.png
  2. Declared type — Content-Type of the multipart part
  3. Allowed — Endpoint allow-list

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

100 — HTTP 100 Continue (HTTP)100413 (Cloudflare 100 MB) — Cloudflare 413 Request Entity Too Large (upload over the plan limit) (Cloudflare)413 (Cloudflare 100 M…415 — HTTP 415 Unsupported Media Type (HTTP)415417 — HTTP 417 Expectation Failed (HTTP)417BadDigest — Upload error: checksum mismatch (BadDigest / Content-MD5 did not match / XAmzContentSHA256Mismatch) (API)BadDigestEntityTooLarge — S3 EntityTooLarge: Your proposed upload exceeds the maximum allowed size (AWS)EntityTooLargefile type is not permitted — WordPress: Sorry, you are not allowed to upload this file type / Sorry, this file type is not permitted for security reasons (WordPress)file type is not perm…HTTP error (media upload) — WordPress Media: “HTTP error.” when uploading images (WordPress)HTTP error (media upl…file_type…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.