Content-Type headers for file URLs
`Content-Type` tells the destination what file bytes are being served. If the URL returns HTML, generic binary, or the wrong MIME type, the next API may reject it.
- Reviewed by
- GetFileURL technical team
- Last updated
What this page answers
Understand Content-Type headers for public file URLs and why OCR, AI, social, document, and automation APIs reject URLs with the wrong MIME type.
Use this page when the workflow needs file bytes available at a direct URL with predictable metadata, lifecycle controls, and a cleanup path.
Updated
Many APIs validate files before processing them.
Destination services often inspect response headers before reading the whole file. The wrong content type can make a valid file look unsupported.
OCR and document APIs
PDF processors may reject a URL if it serves HTML, plain text, or generic binary instead of `application/pdf`.
AI and vision APIs
Image inputs usually need image MIME types and a reachable response body.
Social and CMS APIs
Publishing systems can reject media URLs when headers do not match accepted formats.
The URL can be reachable and still not be a valid file URL.
Opening in a browser is not the same as serving the right machine-readable response. Check headers when a downstream API says the file is invalid.
Preview pages
`text/html` often means the URL points to a viewer page or sign-in prompt.
Missing filename
The extension and content disposition can help logs and imports remain readable.
Wrong source metadata
Base64 and webhook sources need explicit filename and MIME type when the file object does not carry them.
Inspect status, redirects, content type, and size together.
A complete check tells you whether the destination is receiving the expected file or a different response shape.
HTTP status
The URL should return a successful response without auth prompts.
Redirects
Avoid redirect chains when the destination platform does not follow them reliably.
Size and expiry
Confirm the file remains reachable long enough and is within downstream limits.
Answers before the workflow breaks
What Content-Type should a PDF URL return?
A PDF URL should return `application/pdf`, not an HTML preview page or generic text response.
Why does an image URL fail in a vision API?
The URL may be returning a preview page, an unsupported image type, an expired response, or the wrong MIME type.
Does Content-Type matter if the filename has an extension?
Yes. Many APIs validate the response headers and bytes, not only the filename extension.