How to upload Base64 data and get a public URL
Need to turn Base64 data into a public file URL? FilePost accepts encoded bytes in JSON, decodes them, stores the resulting file, and returns a stable CDN URL for the next system in your workflow.
Send data_base64, file_base64, or data with a content_type and filename. The dedicated endpoint is useful when a webhook, AI tool, or serverless function can produce JSON but cannot send multipart form data. This is a Base64-to-public-URL endpoint, not a URL-to-Base64 decoder; for a source that starts as an HTTP(S) URL and needs a stable hosted link, use the remote-file upload endpoint instead.
Upload base64-encoded bytes with FilePost
Use the authenticated FilePost upload API for base64-encoded bytes. The endpoint returns a JSON object containing the public URL, file ID, size, content type, and filename mode.
curl -X POST https://upload.filepost.dev/v1/upload/base64 \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"filename":"invoice.pdf","content_type":"application/pdf","data_base64":"JVBERi0xLjQK..."}'
Example response
{
"url": "https://cdn.filepost.dev/file/…",
"file_id": "a1b2c3d4e5f6",
"name": "invoice.pdf",
"size": 84210,
"content_type": "application/pdf"
}
What to do with the returned URL
Save the returned URL just like a multipart upload URL; the response includes the file ID, size, and content type.
POST /v1/upload/base64 → { "url": "https://cdn.filepost.dev/file/…" }
Good uses for base64 to URL
- Webhook payloads containing encoded files
- AI and serverless workflows that output JSON
- Remote-file responses that need one stable file URL
Know the boundary
Base64 increases payload size and is less efficient than multipart for large files. Use the normal upload endpoint when your client can send multipart form data.
For the complete request and response contract, see the FilePost API documentation. You can also test the flow with the interactive upload on the homepage.