Skip to main content

A FastAPI web file uploader

Project description

Web File Uploader

一個使用 FastAPI 建構的簡單網頁檔案上傳器。

安裝 uv

如果尚未安裝 uv,請先安裝:

# 使用 pip 安裝 uv
pip install uv

# 或使用官方安裝腳本
curl -LsSf https://astral.sh/uv/install.sh | sh

開發和除錯

使用虛擬環境開發

  1. 安裝依賴到現有的虛擬環境:

    cd web-file-uploader
    & ..\venv\Scripts\Activate.ps1
    uv pip install -e .
    
  2. 啟動開發伺服器(支援自動重新載入):

    uvicorn main:app --reload --host 0.0.0.0 --port 8000
    

使用 uvx 部署

在專案目錄中執行:

uvx --from . web-file-uploader

這將安裝依賴並啟動 FastAPI 伺服器在 http://localhost:8000

API 端點

  • GET /: 歡迎訊息和 API 文檔鏈接
  • POST /upload: 上傳檔案(支援 txt, pdf, jpg, jpeg, png, gif, zip)
  • GET /files: 列出已上傳的檔案
  • DELETE /files/{filename}: 刪除指定檔案

API 文檔

啟動伺服器後,訪問 http://localhost:8000/docs 查看完整的互動式 API 文檔。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

web_file_uploader-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

web_file_uploader-0.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file web_file_uploader-0.1.0.tar.gz.

File metadata

  • Download URL: web_file_uploader-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for web_file_uploader-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aef28014c12d35566a67bed9d318f8dee4d203124a612be0e3365e621d0565ce
MD5 c59b218fcd0049ab60d072a3318e7fc2
BLAKE2b-256 2ec463d89b5689fbe7be63a373334dd93632d2aae619a2e7d39158422914e2ae

See more details on using hashes here.

File details

Details for the file web_file_uploader-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: web_file_uploader-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for web_file_uploader-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5756b21fc38afa10b1b3d25de208573e01984d9d0b2af62f30e5913d02fc9e7
MD5 8b99bf9d5709cb4f4b0723b98a38337d
BLAKE2b-256 6b4029bfd5cfeab1cc46b11f051ed9bbfd77182d9de30f435a216130149e3942

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page