Nincs leírás

GeoShaPoh 14edf6e6de Parhelia internet 5 hónapja
static 14edf6e6de Parhelia internet 5 hónapja
templates 33b6909be3 Uploads improve 5 hónapja
.gitignore a06bcbc2e4 Init 5 hónapja
README.md b6e2947ac8 README improve 5 hónapja
app.py 33b6909be3 Uploads improve 5 hónapja
requirements.txt 7d4b8d2233 HokoriTemp V2 5 hónapja

README.md

📁 Flask Temporary File Upload

A lightweight Flask web application for temporary file uploads with automatic expiration and cleanup.

⚡ Quick Start

  1. Clone/Download and navigate to project folder
  2. Create virtual environment: python -m venv venv
  3. Activate environment:
    • Linux/Mac: source venv/bin/activate
    • Windows: venv\Scripts\activate
  4. Install dependencies: pip install -r requirements.txt
  5. Create templates folder: mkdir templates
  6. Place files:
    • app.py in root folder
    • index.html in templates/ folder
  7. Run: python app.py
  8. Open: http://localhost:5000

🚀 Usage Examples

# 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

🔧 Command Options

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

📋 Features

  • Drag & drop file upload
  • Automatic cleanup every 10 minutes
  • Custom expiration (1 hour to 1 week)
  • User sessions via localStorage
  • Secure filenames and validation
  • Responsive design with Tailwind CSS
  • Download links with custom domains
  • File management (upload/download/delete)

🗂️ Project Structure

project/
├── venv/                 # Virtual environment
├── app.py               # Main Flask application
├── requirements.txt     # Dependencies
├── templates/
│   └── index.html      # Web interface
├── uploads/            # Files storage (auto-created)
└── files.db           # SQLite database (auto-created)

🌐 Network Access

  • Localhost only: python app.py
  • LAN access: python app.py --network
  • Custom host: python app.py --host 192.168.1.100

🔒 Security

  • Random 32-character secret key generated on startup
  • Filename sanitization prevents path traversal
  • Session-based file access (users only see their files)
  • Configurable file size limits
  • Automatic expired file cleanup

🛠️ Environment Variables

Set BASE_URL environment variable as alternative to --base-url:

export BASE_URL=https://files.mysite.com
python app.py --network

📝 File Expiration

Users can set file duration when uploading:

  • 1 Hour
  • 6 Hours
  • 24 Hours (default)
  • 3 Days
  • 1 Week

Files are automatically deleted after expiration.

🔍 Help

python app.py --help

Ready to go! 🎉 Your temporary file upload server will be running with automatic cleanup and a modern web interface.