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.1.tar.gz (3.5 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.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: web_file_uploader-0.1.1.tar.gz
  • Upload date:
  • Size: 3.5 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.1.tar.gz
Algorithm Hash digest
SHA256 94c56b7a448ccf66ae72ca8fc203d370ed951446b34e2faeba4383196677d861
MD5 bb639f6e36307b8d87c813fe432a53ef
BLAKE2b-256 79242549c955bbc196e3f78bd43287b381f9b5a743fedf45493fb281de5f6f2c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: web_file_uploader-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b2d762fb47099836fac1e0ddde7aa8b4755e44bd324f78920bd5e89a390419e5
MD5 8e71d31ce06cd0e49d6951a183c1db1e
BLAKE2b-256 2e680addcaf930f3cad39efb1ea2f84619ca380d3c894bbcaea390bf457614a1

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