File Upload with curl

The 3-Step curl Upload: POST, PUT, Confirm

POST metadata, PUT to presigned URL, POST confirm — three curl commands and your file is on the CDN.

files.link's upload API is designed to be curl-able end to end — no SDK, no multipart form gymnastics, just three HTTP calls in a specific order. Here's the full walkthrough you can paste into a shell. Throughout, the auth header is your raw API key with no Bearer prefix: Authorization: $FILESLINK_KEY.

Step 1 — ask for a place to put the bytes. POST your file's metadata to the folder endpoint: curl -s -X POST -H "Authorization: $FILESLINK_KEY" -H 'Content-Type: application/json' -d '{"filesMetadata":[{"name":"report.pdf","size":102400,"type":"application/pdf"}]}' https://api.files.link/v1/files/FOLDER_ID The response shape is { success: true, urls: [{ url, id, ... }] }. The url is a presigned target valid for a short window; id is the file's identifier you'll confirm later.

Step 2 — upload the actual bytes. PUT the file directly to that presigned url — this call goes to storage, not to the API, and carries no auth header (the signature in the URL is the auth): curl -s -X PUT --upload-file ./report.pdf 'PRESIGNED_URL' Add -# if you want a progress bar for a large file.

Step 3 — finalize. Tell the API the bytes landed so the file becomes live and gets its delivery URL: curl -s -X POST -H "Authorization: $FILESLINK_KEY" -H 'Content-Type: application/json' -d '{"ids":["ID"]}' https://api.files.link/v1/files/confirm-upload

To chain it without copy-pasting IDs by hand, capture step 1's output with jq: resp=$(curl -s -X POST ... ); url=$(echo "$resp" | jq -r '.urls[0].url'); id=$(echo "$resp" | jq -r '.urls[0].id'), then run steps 2 and 3 against $url and $id. That's a self-contained uploader in a handful of lines. Wrap those lines in a shell function in your .bashrc or zshrc and you have a portable upload report.pdf command on any machine that has curl and jq.

For unreliable networks, add --retry 3 --retry-connrefused to the step-2 PUT so a dropped connection re-attempts the byte transfer instead of failing the whole pipeline, and -f to the API calls so a non-2xx response sets a non-zero exit code your CI job can catch. Because every call is plain HTTPS over 443, it sails through corporate proxies that block scp and rsync, and it needs no credentials file — unlike aws s3 cp, the only secret is the one API key already in your environment.

Benefits With No Complexity

Global CDN delivery

Your files are served from 450+ edge locations worldwide.

Edge-cached worldwide

Files are cached close to your users for fast delivery.

Signed-URL security

Private files stay protected with time-limited access.

What You Get

Unlimited files

Upload as many files as you need.

Unlimited storage

There is no storage limit.

Public + Private storage

Private files are fully secured.

CDN ready links

Upload directly to 450+ edge locations worldwide.

Prepaid credits

No subscription. Pay only for the storage and bandwidth you use.

More coming soon

We have plenty of features coming!

How files.link Works

1. Upload

Create a project and upload your first file.

2. Copy

Copy the CDN link.

3. Use Anywhere

Paste and enjoy the blazing speed.

Why Developers Choose files.link

A Better Way to Store & Deliver Files

aws s3 cpscp / rsyncFTP clientfiles.link
Three plain HTTP calls, no SDK
Single API key, no credentials file
All traffic over HTTPS/443 (proxy-friendly)
Returns a shareable delivery URL
Built into Linux/macOS/Windows 10+

Calculate Your Needs

Storage

0GB

Egress

0GB

CDN Bandwidth

0GB
Total: $0.000/month

Upload Files with curl

  • Global CDN delivery
  • Edge-cached worldwide
  • Signed-URL security
  • Unlimited files
  • Unlimited storage
  • Public + Private storage
  • No subscription — prepaid credits keep spend predictable
Start Uploading with curl

Frequently Asked Questions

What exactly are the three calls?
POST /v1/files/{folderId} with file metadata returns {success, urls:[{url,id}]}; PUT --upload-file to that presigned url (no auth header — the URL signature is the auth); POST /v1/files/confirm-upload with {"ids":["ID"]} to finalize.
How do I avoid copy-pasting the URL and ID?
Capture step 1's response in a variable and pull .urls[0].url and .urls[0].id with jq -r, then reference those vars in steps 2 and 3. The whole thing fits in a few lines.
How do I authenticate?
Pass your API key as the raw Authorization header value — no Bearer prefix — on the POST calls. The PUT to the presigned URL needs no header.
Can I show a progress bar?
Yes. Add -# to the PUT step (curl -# -X PUT --upload-file ...) for a progress bar, or --progress-bar for cleaner output.
General Questions
Is there a subscription?
No. files.link uses prepaid credits, so storage, bandwidth, and API usage are deducted from your balance as you go. The app explains the payment step before uploads are enabled — no monthly subscription and no per-user fees.
What is files.link?
files.link is a developer-first file platform that makes it simple to store, secure, and deliver files globally. It provides signed URLs, public/private access, and an API-first design so you can integrate file delivery into any app without the usual complexity.
How does billing work?
files.link uses prepaid credits. As you use storage, bandwidth, and API requests, credits are deducted daily. When your balance runs low, we automatically recharge it using your saved card. If an auto-recharge doesn't go through, your files and links stay put — you simply update your payment method or top up manually to keep going. No monthly subscriptions — just simple usage-based pricing.
How secure is my data?
All files are encrypted at rest and in transit. You can use signed URLs for private files, control access with permissions, and rely on enterprise-grade infrastructure for data protection.

Related

files.link
Copyright © 2026
All rights reserved
ContactGuidesGlossaryStatusLegal