Workflow recipe

Turn a Base64 image source into a direct URL

To turn a Base64 image source into a URL, decode the string into image bytes, upload those bytes as multipart field `file`, then map the returned `url` into the next AI, OCR, CMS, or publishing API.

Reviewed by
GetFileURL technical team
Updated
Base64 sourceimage URLmultipart uploadcontent_typecleanup
Recipe shape
Input
Base64 image source
Action
Decode to image bytes, then POST multipart file
Output
Direct image URL
Source
Base64 string or data URI from webhook, AI, or app JSON
Conversion
Decode to bytes and preserve filename plus content_type
Upload
POST /v1/files multipart field file
Short answer

What this page answers

It turns a file already inside a workflow into a direct public URL that another API can fetch.

Reviewed by
GetFileURL technical team
Last updated
Steps

Make the file handoff visible.

A useful Base64 image recipe shows the encoded source, decode step, multipart upload request, returned image URL, and cleanup handle.

01

Capture the file

Start from the Base64 string or data URI your source provides, such as an AI image response, webhook JSON field, canvas export, or low-code app output.

02

Upload and parse JSON

Decode the Base64 content into image bytes, set a real filename and content type, then upload those bytes to `POST /v1/files` as multipart field `file`.

03

Send onward

Pass `url` to the next image, vision, OCR, CMS, or publishing API, then keep `file_id`, `content_type`, and `expires_at` for cleanup.

Checks

Validate the URL before the destination retries.

Most Base64 image URL issues come from one of four places: malformed encoding, data URI prefixes, missing filename or content type, or payloads too large for the source platform.

01

Direct response

The URL should return file bytes, not an app preview, permission page, or redirect loop.

02

Useful headers

Content type, size, and disposition should match what the destination expects.

03

Enough retention

Expiry should account for queue delays, async processing, and retry branches.

Base64 source handling

Treat Base64 as the source format, not the final upload transport.

The public upload endpoint expects a multipart file field. If your source gives Base64, decode it before calling GetFileURL so the hosted URL is based on real image bytes.

01

Strip wrappers

Handle prefixes such as `data:image/png;base64,` before decoding.

02

Keep metadata

Carry a filename and MIME type such as `image/png` into the decoded file object.

03

Upload bytes

Send the decoded image as multipart field `file` to `POST /v1/files`.

Image URL proof

Prove the decoded upload serves image bytes.

After upload, the returned URL should behave like a normal public image URL for AI, OCR, CMS, and publishing tools.

01

Check headers

Run `curl -I <returned-url>` and confirm `200 OK` with `Content-Type: image/png`, `image/jpeg`, or `image/webp`.

02

Map the URL

Use only the returned `url` where the next API asks for an image URL.

03

Clean up

Keep `file_id`, `expires_at`, and `delete_url` beside the image job so public access has an end state.

Examples

Copy the same upload shape into code

Base64 image source
  -> strip data:image/png;base64, prefix if present
  -> decode into image bytes
  -> POST /v1/files as multipart field file
  -> map response.url to the next API
FAQ

Common questions

What does this recipe solve?

It turns a file already inside a workflow into a direct public URL that another API can fetch.

Should the URL be permanent?

Not by default. Use the shortest retention window that gives the destination enough time to fetch the file.

What should I log?

Log the returned URL, file ID, content type, size, expiry, and destination response status.