Base64 to URL

Turn Base64 file payloads into direct URLs

Use GetFileURL when a webhook, AI model, form tool, or API gives you Base64 content but the next service needs a public HTTPS file URL.

base64 to URLJSON uploadfilename requiredcontent typeexpiry
Payload shape

Base64 needs a filename and content type to become a useful URL.

A raw encoded string does not tell the next API what the file is. Send the encoded content with filename, content type, expiry, and metadata.

01

filename

Provide the extension and human-readable name the destination should see.

02

content_type

Set the MIME type so OCR, AI, document, or publishing APIs do not reject the URL.

03

base64

Send only the encoded file content, not a preview page or data URI wrapper unless the API explicitly accepts it.

When to use

Use Base64 input when the source system cannot send multipart files.

Multipart is usually better for large files. Base64 is useful when a source API or automation tool exposes the file only as a string.

01

AI image outputs

Convert generated image strings into public image URLs for moderation, editing, or publishing.

02

Webhook payloads

Handle small encoded files from webhooks that do not support multipart transfer.

03

Form and API bridges

Turn encoded attachments into a URL field that downstream systems can fetch.

Troubleshooting

Validate the encoded file before blaming the destination API.

The URL can only be as useful as the decoded file. Bad padding, wrong MIME type, or missing filename metadata will surface later as fetch failures.

01

Wrong MIME type

If a PNG is labeled as text, image and social APIs may reject it.

02

Large payload

Base64 adds overhead. Use multipart upload for larger files or platform limits that reject large JSON bodies.

03

Data URI prefix

Strip or handle prefixes such as `data:image/png;base64,` according to the final API contract.

Examples

Copy the same upload shape into code or workflow steps

Use the same endpoint from a shell, backend route, worker, or automation code step. Upload the file, set expiry, then map the returned URL.

JSON payload

upload example
curl -X POST https://api.getfileurl.com/v1/files \
  -H 'Authorization: Bearer $GETFILEURL_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "filename": "image.png",
    "content_type": "image/png",
    "expires_in": "24h",
    "base64": "iVBORw0KGgoAAA..."
  }'

JavaScript

upload example
const res = await fetch("https://api.getfileurl.com/v1/files", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.GETFILEURL_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    filename: "image.png",
    content_type: "image/png",
    expires_in: "24h",
    base64,
  }),
});

const { url, file_id } = await res.json();
return { url, file_id };
FAQ

Answers before the workflow breaks

When should I use Base64 instead of multipart upload?

Use Base64 when the source tool only gives you an encoded string. Use multipart upload when you have the file bytes available.

What fields are needed to convert Base64 to a URL?

Send the Base64 content plus filename, content type, and optional expiry or metadata so the returned URL behaves like the original file.

Is Base64 good for large files?

Usually no. Base64 increases payload size and can hit JSON limits. Prefer multipart upload for larger files.

Next pages

Keep building the file URL path

Back to home