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.
File type not allowedUnsupported file typeThe file must be a file of typenot allowed to upload this file typeInvalid file type 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
- Convert to an allowed format (JPEG/PNG/PDF)
- Set the correct MIME type on the file part
- Check the endpoint’s allowed types in the docs
Detailed fix by platform
Node.js
- 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
curl -F 'file=@photo.png;type=image/png' https://api.example.com/v1/uploads
How to diagnose
- Real type — file --mime-type photo.png
- Declared type — Content-Type of the multipart part
- 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:
Similar errors
Most viewed in API
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 14 Oct 2026