python wsgi filter for tus protocol 1.0.0, the tus resumable upload standard.
pip install tusfilter
- app
- required, the wsgi server application
- upload_path
str, required, path of the upload service- tmp_dir
str, optional, directory to store temporary files, default/upload- expire
int, optional, how long before cleanup old uploads in seconds, default60*60*60- send_file
bool, optional,Falsefor send the absolute filepath intmp_dirin the request body,Truefor an actual file uploaded, defaultFalse- max_size
int, optional, maximum size of uploads in bytes, default2**30, 1G
flask
from tusfilter import TusFilter
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 = TusFilter(
app.wsgi_app,
upload_path='/upload_resumable',
tmp_dir='/tmp/upload',
)