Python File Upload

Upload Files From Python With Plain requests

Upload files from Python with a plain HTTP request. No SDK, REST API, CDN delivery, prepaid credits.

If you've wired up file uploads in Python before, you know the boto3 ritual: pin the SDK, point it at credentials and a region, name a bucket, and hope your IAM policy is scoped right. files.link skips all of that and meets Python where it already is — the requests library (or httpx, or urllib3, your call). The upload is three plain HTTP calls. Step one, request a presigned URL by POSTing file metadata to /v1/files/{folderId} with your API key in the Authorization header (raw key, no Bearer prefix); the JSON back is { success, urls: [{ url, id }] }.

Step two, PUT the bytes straight to url. Step three, POST /v1/files/confirm-upload with { "ids": [id] } to finalize. Concretely:

python
import requests

API = "https://api.files.link"
KEY = "YOUR_API_KEY"
FOLDER = "your-folder-id"
PATH = "report.pdf"

# 1. ask for a presigned PUT URL
meta = requests.post(
    f"{API}/v1/files/{FOLDER}",
    headers={"Authorization": KEY},
    json={"filesMetadata": [{"name": "report.pdf"}]},
).json()
slot = meta["urls"][0]

# 2. upload the bytes
with open(PATH, "rb") as f:
    requests.put(slot["url"], data=f)

# 3. confirm
requests.post(
    f"{API}/v1/files/confirm-upload",
    headers={"Authorization": KEY},
    json={"ids": [slot["id"]]},
)

That's the whole integration — no vendor import, nothing to bundle into a Lambda zip, no credentials file. Streaming data=f rather than f.read() keeps memory flat for large files, which matters in workers and serverless. The contract is identical with httpx (sync or async) if you're in an async stack, so an await client.put(...) pipeline drops in cleanly.

Auth is a single header on every call; rotate keys from the dashboard without touching code beyond the env var. Once confirmed, a public file is served from a global CDN URL and a private file via a signed URL with a short default expiry — chosen at upload time, not through a separate subsystem. For files past ~100MB (up to 1TB) there's a multipart variant: initiate, PUT each part to its own presigned URL — easily parallelized with a ThreadPoolExecutor or asyncio.gather — then complete.

Billing is prepaid credits, so a runaway loop costs you credits, not an open-ended surprise invoice. Compared to boto3 you trade a feature-dense SDK for a contract you can read in one screen and call from any Python version. If you're in a web framework, the Flask and FastAPI upload guides show wiring the same three calls behind an endpoint; for the language-agnostic reference, see the cloud file storage API page.

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 (boto3)Google Cloud StorageCloudinary SDKfiles.link
Works with requests / httpx (no SDK)
No credentials file / IAM setup
Streaming PUT (flat memory)
Global CDN delivery included
Public + signed URLs at upload time
Multipart up to 1TB per file
Prepaid credits, no surprise bills

Calculate Your Needs

Storage

0GB

Egress

0GB

CDN Bandwidth

0GB
Total: $0.000/month

Upload Files from Python

  • 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 from Python

Frequently Asked Questions

What does a Python upload look like end to end?
Three requests calls: (1) POST file metadata to /v1/files/{folderId} with your API key header → response is { success, urls: [{ url, id }] }; (2) requests.put(slot['url'], data=open(path,'rb')); (3) POST /v1/files/confirm-upload with { 'ids': [id] }. No boto3, no credentials file. Stream the file handle as data= to keep memory flat.
Does this work with httpx or async code?
Yes. The contract is plain HTTP, so httpx (sync or async), urllib3, or aiohttp all work. In an async stack, await client.put(...) for the bytes and gather the multipart parts concurrently.
How do I authenticate?
Create an API key in the dashboard and pass it in the Authorization header on every call — the raw key, no Bearer prefix. Store it in an env var and rotate from the dashboard without code changes.
What about files larger than 100MB?
Use the multipart flow (up to 1TB): initiate, PUT each part to its presigned URL — parallelize with ThreadPoolExecutor or asyncio.gather — then complete. It avoids loading the whole file into memory.
Where is the uploaded file served from?
Public files get a permanent CDN URL backed by a global edge network. Private files are served via signed URLs with a short default expiry. You choose public vs. private at upload time with a flag.
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