Skip to content
Snippets Groups Projects
Verified Commit 37fb28e5 authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #11954 TIME 0:10 revert check filesize

parent e40064f1
No related branches found
No related tags found
No related merge requests found
......@@ -257,10 +257,13 @@ class ConvertPdfController
return $response->withJson($return);
} else {
$fileAccepted = StoreController::isFileAllowed(['extension' => $ext, 'type' => $mimeType]);
$maxFilesizeMo = ini_get('upload_max_filesize');
$canConvert = ConvertPdfController::canConvert(['extension' => $ext]);
if (!$fileAccepted) {
return $response->withStatus(400)->withJson(['errors' => 'File type not allowed. Extension : ' . $ext . '. Mime Type : ' . $mimeType . '.']);
} elseif ($size/1024 > $maxFilesizeMo*1024) {
return $response->withStatus(400)->withJson(['errors' => 'File maximum size is exceeded ('.$maxFilesizeMo.' Mo)']);
} elseif (!$canConvert) {
return $response->withStatus(400)->withJson(['errors' => 'File accepted but can not be converted in pdf']);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment