跳转到主要内容

python wsgi filter for tus protocol 1.0.0

项目描述

python wsgi filter for tus protocol 1.0.0, tus可恢复上传标准

Fork of https://github.com/everydo/tusfilter with bugfixes for WebOb Request usage.

安装

pip install tuswsgi

参数

app

必需,WSGI服务器应用程序

upload_path

str, 必需,上传服务路径

tmp_dir

str, 可选,存储临时文件的目录,默认 /upload

expire

int,可选,清理旧上传前的时间(秒),默认 60*60*60

send_file

bool,可选,False 表示在请求体中发送 tmp_dir 中的绝对文件路径,True 表示上传的实际文件,默认 False

max_size

int,可选,上传文件的最大大小(字节),默认 2**30,即 1G

示例

flask

from tuswsgi import TusMiddleware
from flask import Flask

app = Flask(__name__)

@app.route("/upload_resumable/<tmpfile>", methods=['PATCH'])
def upload_resumable(tmpfile):
    # do something else
    return 'End of upload'

app.wsgi_app = TusMiddleware(
    app.wsgi_app,
    upload_path='/upload_resumable',
    tmp_dir='/tmp/upload',
)

历史

0.5.5 (2023-03-15)

  • 不要在每个 POST 请求中清理上传的文件。

项目详情


下载文件

下载适用于您平台的应用程序。如果您不确定该选择哪个,请了解有关 安装包 的更多信息。

源分发

tuswsgi-0.5.5.tar.gz (7.5 kB 查看哈希值)

上传时间

构建分发

tuswsgi-0.5.5-py2.py3-none-any.whl (6.9 kB 查看哈希值)

上传时间 Python 2 Python 3

由以下机构支持