|
|
hace 3 meses | |
|---|---|---|
| static | hace 3 meses | |
| templates | hace 3 meses | |
| .gitignore | hace 5 meses | |
| README.md | hace 3 meses | |
| app.py | hace 3 meses | |
| requirements.txt | hace 5 meses |
A lightweight Flask web application for temporary file uploads with automatic expiration and cleanup.
python -m venv venvsource venv/bin/activatevenv\Scripts\activatepip install -r requirements.txtmkdir templatesapp.py in root folderindex.html in templates/ folderpython app.py# Basic (localhost only)
python app.py
# Network access (all devices on LAN)
python app.py --network
# Custom domain/URL
python app.py --base-url https://files.mysite.com
# Large files (100MB limit)
python app.py --max-file-size 100
# Production example
python app.py --network --port 8080 --max-file-size 50 --base-url https://uploads.mydomain.com
| Option | Description | Default |
|---|---|---|
--host |
Bind to specific host | 127.0.0.1 |
--port |
Port number | 5000 |
--network |
Allow network access (0.0.0.0) | False |
--base-url |
Custom URL for download links | auto |
--max-file-size |
Max file size in MB | 16 |
--debug |
Enable debug mode | False |
project/
├── venv/ # Virtual environment
├── app.py # Main Flask application
├── requirements.txt # Dependencies
├── templates/
│ ├── index.html # Main web interface
│ └── download.html # File information and preview page
├── static/
│ ├── css/
│ │ └── styles.css # Custom styles
│ └── js/
│ └── main.js # Frontend JavaScript
├── uploads/ # Files storage (auto-created)
└── files.db # SQLite database (auto-created)
python app.pypython app.py --networkpython app.py --host 192.168.1.100Set BASE_URL environment variable as alternative to --base-url:
export BASE_URL=https://files.mysite.com
python app.py --network
For RAR file preview support, install the rarfile library:
pip install rarfile
Note: RAR support also requires the UnRAR library to be installed on your system:
sudo apt-get install unrar or sudo yum install unrarbrew install unrarWithout rarfile, the application will work normally but won't preview RAR archives.
Users can set file duration when uploading:
Files are automatically deleted after expiration.
python app.py --help
Ready to go! 🎉 Your temporary file upload server will be running with automatic cleanup and a modern web interface.