Guide

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
Content-TypeMIME typeheadersOCRAI APIs
Short answer

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

Why headers matter

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.

01

OCR and document APIs

PDF processors may reject a URL if it serves HTML, plain text, or generic binary instead of `application/pdf`.

02

AI and vision APIs

Image inputs usually need image MIME types and a reachable response body.

03

Social and CMS APIs

Publishing systems can reject media URLs when headers do not match accepted formats.

Common mistakes

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.

01

Preview pages

`text/html` often means the URL points to a viewer page or sign-in prompt.

02

Missing filename

The extension and content disposition can help logs and imports remain readable.

03

Wrong source metadata

Base64 and webhook sources need explicit filename and MIME type when the file object does not carry them.

How to debug

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.

01

HTTP status

The URL should return a successful response without auth prompts.

02

Redirects

Avoid redirect chains when the destination platform does not follow them reliably.

03

Size and expiry

Confirm the file remains reachable long enough and is within downstream limits.

FAQ

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.