diff --git a/fileserver/config/default/fileserver.conf b/fileserver/config/default/fileserver.conf index f076ec1..4ba2b8f 100644 --- a/fileserver/config/default/fileserver.conf +++ b/fileserver/config/default/fileserver.conf @@ -10,6 +10,11 @@ delete { allow_batch: true } +upload { + # the max size in Mb of the upload contents in one upload call + max_upload_size_mb: 0 +} + cors { origins: "*" } diff --git a/fileserver/fileserver.py b/fileserver/fileserver.py index 2984b6c..a150fde 100644 --- a/fileserver/fileserver.py +++ b/fileserver/fileserver.py @@ -35,6 +35,9 @@ app.config["UPLOAD_FOLDER"] = first( app.config["SEND_FILE_MAX_AGE_DEFAULT"] = config.get( "fileserver.download.cache_timeout_sec", 5 * 60 ) +if max_upload_size := config.get("fileserver.upload.max_upload_size_mb", None): + app.config["MAX_CONTENT_LENGTH"] = max_upload_size * 1024 + auth_handler = AuthHandler.instance()