Rust File Upload

Upload Files From Rust With reqwest Multipart

Upload files from Rust with reqwest multipart. No SDK, REST API, CDN delivery, prepaid credits.

Pulling aws-sdk-s3 into a Rust project drags in a large dependency tree, a credential provider chain, and region/endpoint config before you've moved a byte. files.link is just HTTP, so the reqwest crate you probably already have covers the whole upload in three calls — and the same shape works with surf, ureq, or hyper if you prefer, on tokio, async-std, or the blocking client.

The flow: POST file metadata to /v1/files/{folderId} with your API key in the Authorization header (raw key, no Bearer prefix) to get back { success, urls: [{ url, id }] }; PUT the bytes to url; POST /v1/files/confirm-upload with { ids: [id] }. With async reqwest:

rust
use reqwest::Client;
use serde_json::json;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let api = "https://api.files.link";
    let key = std::env::var("FILESLINK_KEY")?;
    let folder = "your-folder-id";
    let client = Client::new();

    // 1. request a presigned PUT URL
    let meta: serde_json::Value = client
        .post(format!("{api}/v1/files/{folder}"))
        .header("Authorization", &key)
        .json(&json!({ "filesMetadata": [{ "name": "build.tar.gz" }] }))
        .send().await?.json().await?;
    let url = meta["urls"][0]["url"].as_str().unwrap();
    let id = meta["urls"][0]["id"].as_str().unwrap();

    // 2. upload the bytes
    let bytes = tokio::fs::read("build.tar.gz").await?;
    client.put(url).body(bytes).send().await?;

    // 3. confirm
    client.post(format!("{api}/v1/files/confirm-upload"))
        .header("Authorization", &key)
        .json(&json!({ "ids": [id] }))
        .send().await?;
    Ok(())
}

No vendor crate, no credential chain — one header and three requests. For genuine multipart form bodies reqwest's multipart::Form is there, but the presigned PUT above is the simpler path for a single object. Because there's no SDK assuming a runtime, this compiles cleanly into a CLI tool, a background worker, or a WASM-adjacent service without fighting feature flags.

For large artifacts (up to 1TB) use the multipart upload endpoint: initiate, PUT each part to its presigned URL — futures::future::join_all lets you push parts concurrently — then complete, all without holding the whole file in memory. Confirmed public files come back as permanent CDN URLs; private files use signed URLs with a short expiry, selected at upload via a flag.

Billing is prepaid credits, so a misbehaving retry loop burns credits rather than opening an unbounded invoice. There's no official Rust SDK and you don't need one — the REST contract is the whole surface, and reqwest's strong typing via serde gives you the ergonomics an SDK would. If you also share Rust snippets, see the rust-paste page; for the cross-language endpoint reference, the cloud file storage API page covers every route.

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 (aws-sdk-s3)CloudinaryBackblaze B2files.link
Works with reqwest / surf / ureq
Runtime-agnostic (tokio / async-std / blocking)
No credential provider chain
Concurrent multipart up to 1TB
Global CDN delivery included
Public + signed URLs at upload time
Prepaid credits, no surprise bills

Calculate Your Needs

Storage

0GB

Egress

0GB

CDN Bandwidth

0GB
Total: $0.000/month

Upload Files from Rust

  • 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 Rust

Frequently Asked Questions

What does a Rust upload look like?
Three reqwest calls: (1) .post('/v1/files/{folderId}').header('Authorization', key).json(&metadata) → decode { urls: [{ url, id }] }; (2) .put(url).body(bytes); (3) .post('/v1/files/confirm-upload').json(&json!({ 'ids': [id] })). No aws-sdk crate, no credential chain — one header and three requests.
Does it work on tokio?
Yes, and on async-std or the blocking client. The contract is plain HTTP with no SDK assuming a runtime, so reqwest, surf, ureq, or hyper all work under whatever executor your service already uses.
How do I upload large files efficiently?
Use the multipart endpoint (up to 1TB): initiate, PUT each part to its own presigned URL, then complete. futures::future::join_all pushes parts concurrently, and you never hold the whole file in memory.
Is there an official Rust SDK?
No, and you don't need one. The REST API is the entire surface; reqwest plus serde gives you typed requests and responses, which is most of what an SDK would provide anyway.
How are uploaded files served?
Public files return a permanent CDN URL from a global edge network; private files use signed URLs with a short default expiry. Pick public or 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