upload path

This commit is contained in:
Michael Grote 2023-04-13 12:01:05 +02:00
parent 4c942b35d0
commit d9191b17af

4
app.py
View file

@ -4,7 +4,7 @@ import uuid
from flask import Flask, request, jsonify, send_from_directory
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = os.environ.get('UPLOAD_FOLDER', './uploads')
app.config['UPLOAD_FOLDER'] = os.environ.get('UPLOAD_FOLDER', '/uploads')
app.config['MAX_CONTENT_LENGTH'] = int(os.environ.get('MAX_CONTENT_LENGTH', '5')) * 1024 * 1024 # in MB
VALID_FILENAME_REGEX = r'^[a-zA-Z0-9\-_\.]+$'
@ -50,7 +50,7 @@ if __name__ == '__main__':
# Upload
# curl -X POST -H "Authorization: Bearer myuploadtoken" -F "file=@/path/to/file" http://docker10.grote.lan:5040/upload
# curl -X POST -H "token: myuploadtoken" -F "file=@/path/to/file" http://docker10.grote.lan:5040/upload
# Download
# curl -X GET http://docker10.grote.lan:5040/download/filename.ext > filename.ext
# List