mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-12-09 15:53:36 +00:00
fix checking upload error
This commit is contained in:
parent
b3b5d11642
commit
5567b57853
|
|
@ -136,16 +136,19 @@ if(!$file_ary) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$file = $file_ary[0];
|
$file = $file_ary[0];
|
||||||
if ($file['error'] == 0) {
|
/* Handle specific error 1 because it happens often */
|
||||||
if($file['error']==1) {
|
if($file['error']==1) {
|
||||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("uploading_maxsize"));
|
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("uploading_maxsize"));
|
||||||
}
|
}
|
||||||
|
/* All other errors just have a generic message */
|
||||||
if($file['error']!=0) {
|
if($file['error']!=0) {
|
||||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("uploading_failed"));
|
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("uploading_failed"));
|
||||||
}
|
}
|
||||||
|
/* Catch uploading files without content */
|
||||||
if ($file["size"]==0) {
|
if ($file["size"]==0) {
|
||||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("uploading_zerosize"));
|
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("uploading_zerosize"));
|
||||||
}
|
}
|
||||||
|
/* Check if file size is above configured max upload size */
|
||||||
$maxuploadsize = SeedDMS_Core_File::parse_filesize($settings->_maxUploadSize);
|
$maxuploadsize = SeedDMS_Core_File::parse_filesize($settings->_maxUploadSize);
|
||||||
if ($maxuploadsize && $file["size"] > $maxuploadsize) {
|
if ($maxuploadsize && $file["size"] > $maxuploadsize) {
|
||||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("uploading_maxsize"));
|
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("uploading_maxsize"));
|
||||||
|
|
@ -161,7 +164,6 @@ if ($file['error'] == 0) {
|
||||||
if($tmpfiletype != 'application/octet-stream')
|
if($tmpfiletype != 'application/octet-stream')
|
||||||
$userfiletype = $tmpfiletype;
|
$userfiletype = $tmpfiletype;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Check if the uploaded file is identical to last version */
|
/* Check if the uploaded file is identical to last version */
|
||||||
$lc = $document->getLatestContent();
|
$lc = $document->getLatestContent();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user