From 39265e40851af56594abc840442b66ff333904ae Mon Sep 17 00:00:00 2001 From: Tom Pollard Date: Mon, 3 Jul 2023 00:45:51 -0400 Subject: [PATCH 1/2] add configuration for data upload Django allows (1) max memory size of uploads to be set and (2) max number of files to be set. We currently use the default values. See: https://docs.djangoproject.com/en/4.2/ref/settings/#std-setting-DATA_UPLOAD_MAX_NUMBER_FILES for more detail. --- physionet-django/physionet/settings/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/physionet-django/physionet/settings/base.py b/physionet-django/physionet/settings/base.py index 4111cb57d2..3d0f107e2f 100644 --- a/physionet-django/physionet/settings/base.py +++ b/physionet-django/physionet/settings/base.py @@ -623,3 +623,7 @@ class StorageTypes: # minimum number of word needed for research_summary field for Credentialing Model. MIN_WORDS_RESEARCH_SUMMARY_CREDENTIALING = config('MIN_WORDS_RESEARCH_SUMMARY_CREDENTIALING', cast=int, default=20) + +# Django configuration for file upload (see https://docs.djangoproject.com/en/4.2/ref/settings/) +DATA_UPLOAD_MAX_NUMBER_FILES = config('DATA_UPLOAD_MAX_NUMBER_FILES', cast=int, default=1000) +DATA_UPLOAD_MAX_MEMORY_SIZE = config('DATA_UPLOAD_MAX_MEMORY_SIZE', cast=int, default=2621440) From 15b98f7940964292bbe81a7b1dd6f2368c3b233b Mon Sep 17 00:00:00 2001 From: Tom Pollard Date: Mon, 3 Jul 2023 00:48:07 -0400 Subject: [PATCH 2/2] add file upload defaults to env file. --- .env.example | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.env.example b/.env.example index 1a2f1706fd..ff738bf0f4 100644 --- a/.env.example +++ b/.env.example @@ -191,3 +191,8 @@ MIN_WORDS_RESEARCH_SUMMARY_CREDENTIALING = 20 CITI_USERNAME= CITI_PASSWORD= CITI_SOAP_URL="https://webservices.citiprogram.org/SOAP/CITISOAPService.asmx" + +# Django configuration for file upload +# See https://docs.djangoproject.com/en/4.2/ref/settings/ +DATA_UPLOAD_MAX_NUMBER_FILES=1000 +DATA_UPLOAD_MAX_MEMORY_SIZE=2621440