check against maxuploadsize when uploading a new document

This commit is contained in:
Uwe Steinmann 2020-05-13 09:25:30 +02:00
parent f72e70d9a6
commit d7dccfd299

View File

@ -660,6 +660,13 @@ switch($command) {
exit; exit;
} }
$maxuploadsize = SeedDMS_Core_File::parse_filesize($settings->_maxUploadSize);
if ($maxuploadsize && $_FILES["userfile"]["size"] > $maxuploadsize) {
header('Content-Type: application/json');
echo json_encode(array('success'=>false, 'message'=>getMLText("uploading_maxsize")));
exit;
}
$userfiletmp = $_FILES["userfile"]["tmp_name"]; $userfiletmp = $_FILES["userfile"]["tmp_name"];
$userfiletype = $_FILES["userfile"]["type"]; $userfiletype = $_FILES["userfile"]["type"];
$userfilename = $_FILES["userfile"]["name"]; $userfilename = $_FILES["userfile"]["name"];