Skip to content

Commit

Permalink
Merge pull request #944 from ucfopen/issue/942-large-files
Browse files Browse the repository at this point in the history
Update nginx configurations and php.ini to increase maximum file size.
  • Loading branch information
dmols authored May 1, 2024
2 parents c4ceac6 + b2846aa commit c096ab5
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions assets/js/Components/FilesModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}

Expand Down
3 changes: 2 additions & 1 deletion build/nginx/deploy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ server {

rewrite ^/udoit3/(.*)$ /$1 break;
try_files $uri @symfonyFront;
client_max_body_size 10M;
}

set $symfonyRoot /var/www/html/public;
Expand All @@ -29,4 +30,4 @@ server {
}
error_log /var/log/nginx/project_error.log;
access_log /var/log/nginx/project_access.log;
}
}
3 changes: 2 additions & 1 deletion build/nginx/local.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ server {

rewrite ^/udoit3/(.*)$ /$1 break;
try_files $uri @symfonyFront;
client_max_body_size 10M;
}

set $symfonyRoot /var/www/html/public;
Expand All @@ -29,4 +30,4 @@ server {
}
error_log /var/log/nginx/project_error.log;
access_log /var/log/nginx/project_access.log;
}
}
2 changes: 2 additions & 0 deletions build/nginx/php-custom.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
max_execution_time = 180
memory_limit = 800M
upload_max_filesize = 10M
post_max_size = 10M
1 change: 1 addition & 0 deletions translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",

Expand Down
1 change: 1 addition & 0 deletions translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",

Expand Down

0 comments on commit c096ab5

Please sign in to comment.