Building a Temporary File Uploader
How To Build a Temporary File Ditch
Hey everyone! I wanted to share a little project I've been working on called FileDitch. It's a straightforward file sharing service that lets you upload files and share them via URLs that automatically expire. Think of it as a minimalist, self-hosted WeTransfer alternative.
Why Build This?
I frequently need to share files that are too big for email or discord but don't need permanent storage. While there are plenty of services out there, I wanted something I could host myself and customize according to my needs. Plus, it was a fun project to work on!
How It Works
Here's a quick overview of how FileDitch operates:
The flow is pretty simple:
- Upload interface is password protected (keeps things simple)
- Files get a randomized URL
- Anyone can download without authentication
- Files auto-delete after they expire
Technical Implementation
I built this using Node.js with Express for the backend and kept the frontend minimal with vanilla JavaScript. Here's the core architecture:
Some key technical decisions:
- SQLite over Redis because it's simpler for a single container setup
- File system storage instead of S3 to keep it self-contained
- Password-only security to avoid user management
- URL format: filename_randomstring.extension for clean sharing
Interesting Challenges
The trickiest parts were:
- Handling concurrent uploads with unique filenames
- Ensuring clean file deletion on expiry
- Proper mime-type handling for downloads
- Rate limiting uploads while keeping downloads open
Want to Try It?
The project is open source and pretty easy to self-host. You just need:
- Docker
- A reverse proxy for SSL (I use Nginx)
- Basic environment configuration
Check out the repo if you want to run your own instance!
What's Next?
I'm thinking about adding:
- Optional client-side encryption
- Better file type validation
- Multiple simultaneous uploads
- Basic analytics dashboard
Let me know if you have any questions or suggestions!