A simple raw API for uploading files and generating one-time download links.
Built with Node.js, Express, and Multer.
- 📁 Upload any file
- 🔗 Get a direct download link
- 🧩 Pure API — no frontend
- 🔒 Works locally or expose via
ngrok
1️⃣ Clone the repo
git clone https://github.com/yourusername/temp-file-server.git
cd temp-file-servernpm install🏃♂️ Running locally Start the server:
npm start📤 Upload a file Use cURL, Postman, or any client:
curl -F "file=@yourfile.txt" http://localhost:3000/uploadfile📥 Download a file Visit the link in your browser, or curl it:
curl -O http://localhost:3000/download/<id>🌍 Expose your server (Windows) 1️⃣ Using ngrok
Download ngrok & add to PATH
ngrok http 3000Copy the HTTPS forwarding link Use it to upload or download files, e.g. https://abc123.ngrok.io/uploadfile
✅ Using Cloudflared
Download Cloudflared & add it to your PATH.
Run a tunnel:
cloudflared tunnel --url http://localhost:3000Use the generated trycloudflare.com link:
https://abc123.trycloudflare.com/uploadfile****