diff --git a/assets/js/Components/FilesModal.js b/assets/js/Components/FilesModal.js index 5043f6db..f34e5888 100644 --- a/assets/js/Components/FilesModal.js +++ b/assets/js/Components/FilesModal.js @@ -249,6 +249,13 @@ class FilesModal extends React.Component { return } + if(file.size > 1024 * 1024 * 10) { + this.addMessage({severity: 'error', message: this.props.t('msg.file.replace.file_size'), timeout: 5000}) + this.setState({ replaceFileObj: null }) + this.forceUpdate() + return + } + this.setState({ replaceFileObj: file }) } diff --git a/build/nginx/deploy.conf b/build/nginx/deploy.conf index 48167ce8..b8239445 100644 --- a/build/nginx/deploy.conf +++ b/build/nginx/deploy.conf @@ -9,6 +9,7 @@ server { rewrite ^/udoit3/(.*)$ /$1 break; try_files $uri @symfonyFront; + client_max_body_size 10M; } set $symfonyRoot /var/www/html/public; @@ -29,4 +30,4 @@ server { } error_log /var/log/nginx/project_error.log; access_log /var/log/nginx/project_access.log; -} \ No newline at end of file +} diff --git a/build/nginx/local.conf b/build/nginx/local.conf index 65ebd3eb..4f037e1e 100644 --- a/build/nginx/local.conf +++ b/build/nginx/local.conf @@ -9,6 +9,7 @@ server { rewrite ^/udoit3/(.*)$ /$1 break; try_files $uri @symfonyFront; + client_max_body_size 10M; } set $symfonyRoot /var/www/html/public; @@ -29,4 +30,4 @@ server { } error_log /var/log/nginx/project_error.log; access_log /var/log/nginx/project_access.log; -} \ No newline at end of file +} diff --git a/build/nginx/php-custom.ini b/build/nginx/php-custom.ini index 7c7de96e..b5d5e8d3 100644 --- a/build/nginx/php-custom.ini +++ b/build/nginx/php-custom.ini @@ -1,2 +1,4 @@ max_execution_time = 180 memory_limit = 800M +upload_max_filesize = 10M +post_max_size = 10M diff --git a/translations/en.json b/translations/en.json index 816e1b07..58010526 100644 --- a/translations/en.json +++ b/translations/en.json @@ -133,6 +133,7 @@ "msg.sync.started": "Course scan started.", "msg.sync.failed": "Course scan failed. Course is missing.", "msg.file.replace.file_type": "File type not accepted. Please input a file with the correct filetype.", + "msg.file.replace.file_size": "File size too large. Please input a file of a size less than 10MB", "msg.sync.completed": "Course scan completed.", "msg.sync.course_inactive": "Course scan failed. Course is inactive.", @@ -384,4 +385,4 @@ "rule.label.SearchKeyWord": "Keyword found", "rule.desc.SearchKeyWord": "The keyword has been found" -} \ No newline at end of file +} diff --git a/translations/es.json b/translations/es.json index 001df103..b14aa810 100644 --- a/translations/es.json +++ b/translations/es.json @@ -133,6 +133,7 @@ "msg.sync.started": "Se inició el escaneo del curso.", "msg.sync.failed": "Falló el escaneo del curso. Falta el curso.", "msg.file.replace.file_type": "El tipo de archivo no es válido. Por favor aporte un archivo de tipo correcto.", + "msg.file.replace.file_size": "El tamaño del archivo es demasiado grande. Por favor aporte un archivo de tamaño menor a 10MB", "msg.sync.completed": "Escaneo del curso completado.", "msg.sync.course_inactive": "Falló el escaneo del curso. El curso está inactivo.",