v2.1.0 — now with FTP & SFTP support

File uploads.
Done right.
Finally.

The Express.js upload middleware that handles AWS S3, Azure, GCS, Cloudinary, FTP & SFTP — with validation, compression & TypeScript in one clean config object.

MIT License TypeScript Ready ESM + CJS Built on Multer
↗ View on npm ★ Star on GitHub
npm install upload-smith
6+
Cloud Providers
1
Config Object
0%
Boilerplate
File Types

Features

Everything you need.
Nothing you don't.

Stop patching together five libraries. Upload Smith gives you a production-ready upload pipeline in minutes.

☁️

6 Cloud Providers

AWS S3, Azure Blob, Google Cloud Storage, Cloudinary, FTP, and SFTP — all from one unified API.

🔒

Extension Validation

Whitelist exactly which file types are allowed per upload endpoint. Rejects everything else automatically.

📏

Per-Extension Size Limits

Set different size caps for different file types — 5MB for images, 20MB for PDFs, 100MB for video.

🖼️

Image Compression

Built-in Sharp integration compresses JPEG, PNG, WebP on the fly before uploading to cloud or disk.

📥

URL Import

Download and process files directly from URLs. Supports domain whitelisting and blacklisting for security.

🧹

Automatic Cleanup

Files are auto-deleted from both local disk and cloud storage when an error occurs. No orphaned files.

🔄

Partial Uploads

When uploading multiple files, save the valid ones and reject invalid ones — with per-file rejection reasons.

💪

Full TypeScript Support

Complete type definitions included. Works seamlessly with both ESM and CommonJS projects.

📁

Smart Folder Organization

Organize uploads by extension, by category, or both. Keeps your storage clean and structured automatically.


Providers

One package.
Every cloud.

Switch providers by changing a single string. Your application code stays identical.

AWS S3
Azure Blob
Google Cloud Storage
Cloudinary
SFTP
FTP
Local Disk

Quickstart

Ship uploads in
< 10 lines.

Replace your entire cloud upload boilerplate with a single createUploader() call.

  • 01 Choose your provider — AWS, Azure, GCS, Cloudinary, FTP or SFTP
  • 02 Configure allowed extensions, size limits and optional compression
  • 03 Drop uploader.single() or uploader.multiple() as middleware
  • 04 Read req.file.cloudUrl — you're done ✓
upload.js
import { createUploader } from 'upload-smith' const uploader = createUploader({ fieldName: 'file', allowedExtensions: ['jpg', 'png', 'pdf'], compressImage: true, imageQuality: 85, sizeConfig: { perExtensionMB: { jpg: 10, pdf: 25 } }, cloudStorage: { enabled: true, provider: 'aws', // or 'azure' | 'gcs' | etc. aws: { region: process.env.AWS_REGION, bucket: process.env.AWS_BUCKET, accessKeyId: process.env.AWS_KEY, secretAccessKey: process.env.AWS_SECRET, }, keepLocalCopy: false, }, }) app.post('/upload', uploader.single(), (req, res) => { res.json({ url: req.file.publicUrl }) })

Storage Modes

Deploy anywhere.

Three storage strategies to match any architecture — dev, prod, or hybrid.

💾

Local Only

Files saved to disk. No cloud config needed. Perfect for development and simple apps.

no cloudStorage config
RECOMMENDED
☁️

Cloud Only

Files go straight to cloud. No disk usage. Ideal for production and serverless deployments.

keepLocalCopy: false
🔄

Cloud + Local Copy

Uploads to cloud AND saves a local copy. Great for backups and migration periods.

keepLocalCopy: true

Comparison

Why not just
use raw Multer?

Multer is great — Upload Smith just removes the 200 lines you'd write around it.

Capability Raw Multer upload-smith
AWS S3 uploads Manual SDK setup Built-in
Azure Blob Storage Built-in
Google Cloud Storage Built-in
Cloudinary Built-in
FTP / SFTP Built-in
Extension validation Manual fileFilter Config option
Per-extension size limits Config option
Image compression Via Sharp
URL download support Built-in
Auto cleanup on error Default on
Partial multi-file uploads Config option
TypeScript definitions @types/multer Full types included

Get Started

One install.
Ship everything.

Your next upload feature starts here.

↗ Install from npm Read the Docs ☕ Support the Author