Express File Upload

Upload Files from Express Route Handlers (Drop multer + aws-sdk)

Upload files from Express route handlers with fetch or axios. No SDK, REST API, CDN delivery.

The classic Express upload stack is multer to parse multipart, aws-sdk to push to S3, and a pile of IAM and bucket config to make it work. files.link collapses that into three HTTP calls from your route handler — using Node's built-in fetch (Node 18+) or axios — and the headline win is that you can skip multer entirely for the common case by streaming the raw request body straight to the presigned URL.

If your client sends the file as a raw binary body (the simplest case), you never buffer it on disk:

js
import express from 'express';
const app = express();
const KEY = process.env.FILESLINK_KEY;
const BASE = 'https://api.files.link';

app.post('/upload', express.raw({ type: '*/*', limit: '50mb' }), async (req, res) => {
  const r1 = await fetch(`${BASE}/v1/files/${process.env.FOLDER_ID}`, {
    method: 'POST',
    headers: { Authorization: KEY, 'Content-Type': 'application/json' },
    body: JSON.stringify({ filesMetadata: [{ name: req.query.name, size: req.body.length, type: req.headers['content-type'] }] }),
  });
  const slot = (await r1.json()).urls[0];

  await fetch(slot.url, { method: 'PUT', headers: { 'Content-Type': req.headers['content-type'] || 'application/octet-stream' }, body: req.body });

  await fetch(`${BASE}/v1/files/confirm-upload`, {
    method: 'POST',
    headers: { Authorization: KEY, 'Content-Type': 'application/json' },
    body: JSON.stringify({ ids: [slot.id] }),
  });
  res.json({ id: slot.id });
});

If you must accept a browser multipart/form-data form, you still need a parser — but reach for busboy or formidable, not multer, because you only want the file stream, not multer's disk/memory storage engines. Pipe the parsed file stream directly to the presigned PUT; Node fetch accepts a ReadableStream as the body, so a large upload never fully lands in process memory. Prefer axios? The same three calls work — set responseType and pass a stream as data.

Keep the API key in process.env.FILESLINK_KEY (via dotenv in dev, host secrets in prod) and send it as the raw Authorization value with no Bearer prefix. You get back CDN-backed URLs with per-file visibility, storage encrypted at rest, and prepaid-credit billing instead of a metered S3 egress invoice — no IAM user, no bucket policy, no SDK in node_modules.

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

multer + aws-sdkCloudinary (multer-storage-cloudinary)files.link
No multer middleware required
No SDK install (built-in fetch / axios)
Stream request body straight to storage
Global CDN delivery on every file
Prepaid credits (no surprise bills)

Calculate Your Needs

Storage

0GB

Egress

0GB

CDN Bandwidth

0GB
Total: $0.000/month

Wire Up Express File Uploads

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

Frequently Asked Questions

Can I drop multer entirely?
For raw binary uploads, yes — use express.raw() and pipe req.body straight to the presigned PUT. For browser multipart forms you still need a parser, but busboy or formidable is lighter than multer since you only want the file stream.
Do I need the aws-sdk?
No. The three files.link calls go through Node's built-in fetch or axios. There is no S3 client, no IAM user, and no bucket policy to manage.
How do I stream large files without high memory use?
Pipe the incoming request (or the busboy file stream) directly into the presigned PUT. Node fetch accepts a ReadableStream as the body, so the file is never fully buffered in process memory.
Does this work with axios instead of fetch?
Yes. The three calls map directly onto axios.post / axios.put. Pass a stream as the request data and set the Authorization header to the raw API key.
Where do I store the API key?
In process.env.FILESLINK_KEY, loaded with dotenv in development and from host secrets in production. Send it as the raw Authorization header value — no Bearer prefix — and keep it out of git.
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