Temp File Transfer Service

A Flask-based personal temporary file sharing service with a Web UI, API access, and SQLite-backed metadata.

What it does

  • Upload files via a Web UI or an API endpoint
  • Choose an expiry: 1 hour, 24 hours, or 7 days
  • Generate a share URL (UUID) for downloaded access
  • File data stored on disk; metadata stored in SQLite
  • Web-based download page and a simple API for programmatic uploads

Tech stack

  • Flask (Python)
  • SQLite (metadata)
  • Filesystem storage for actual file data

Local development setup

  1. Prerequisites
  • Python 3.8+ (the project currently uses Python 3.x in this environment)
  • pip
  1. Install dependencies
pip install -r requirements.txt
  1. Run the server
python app.py
  1. Access

Project layout

  • app.py # Flask application
  • config.py # Configuration constants
  • database.py # SQLite helpers and data access
  • requirements.txt # Python dependencies
  • templates/ # Jinja templates (index.html, download.html)
  • upload_client.py # Simple API client example for testing
  • uploads/ # Storage for uploaded files (created at runtime)

Data model (SQLite)

  • Table: files
    • id TEXT PRIMARY KEY
    • filename TEXT
    • filepath TEXT
    • filesize INTEGER
    • expiry_hours INTEGER
    • created_at TIMESTAMP
    • expires_at TIMESTAMP

Expiry and cleanup

  • Expiry options are defined as 1h, 24h, 7d in config
  • A cleanup operation removes expired files from disk and deletes DB rows
  • Cleanup is invoked on access endpoints (and can be wired to a cron/daemon later)

Security notes

  • Do not commit secrets. Secrets should be provided via environment variables in production.
  • This repository currently avoids embedding credentials.

Next steps (optional)

  • Add authentication for admin/API usage
  • Add rate limiting and upload size limits per user
  • Add automated tests and CI integration

License

  • MIT or your preferred license (update as needed)

Contributing

  • Pull requests are welcome. Please follow the project style and ensure tests pass.

Contact

  • If you need to reach the maintainer, use your preferred channel.
Description
放在云服务器上,用于上传临时文件共享的站点。
Readme 112 KiB
Languages
Python 51.8%
HTML 26.1%
Rust 21.7%
Batchfile 0.4%