Skip to content

Commit b15971d

Browse files
committed
Handle post_max_size limit exhaustion error
1 parent 4ca18d4 commit b15971d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

modules/electrophysiology_uploader/php/upload.class.inc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@ class Upload extends \NDB_Page
122122
$candID = $values['candID'] ?? null;
123123
$visitLabel = $values['visit'] ?? null;
124124

125+
if (empty($request->getUploadedFiles()) && empty($values)) {
126+
$upload_max_size = \Utility::getMaxUploadSize();
127+
return new \LORIS\Http\Response\JSON\InternalServerError(
128+
"The uploaded file size ($upload_max_size) exceeds " .
129+
"the upload_max_filesize or post_max_size directive in php.ini"
130+
);
131+
}
132+
125133
if (is_null($uploadedFile)) {
126134
return new \LORIS\Http\Response\JSON\BadRequest(
127135
'No file uploaded'

0 commit comments

Comments
 (0)