1
0
Fork 0
mirror of synced 2024-07-03 13:41:01 +12:00

skipping file type validation for now

This commit is contained in:
Damodar Lohani 2021-06-18 14:20:46 +05:45
parent 71a69a1dd8
commit 3c4ba79103

View file

@ -289,7 +289,7 @@ App::post('/v1/storage/buckets/:bucketId/files')
/*
* Validators
*/
$fileType = new FileType($bucket->getAttribute('allowedFileExtensions', ['*']));
// $fileType = new FileType($bucket->getAttribute('allowedFileExtensions', ['*']));
$fileSize = new FileSize($bucket->getAttribute('maximumFileSize', 0));
$upload = new Upload();
@ -303,9 +303,9 @@ App::post('/v1/storage/buckets/:bucketId/files')
$file['size'] = (\is_array($file['size']) && isset($file['size'][0])) ? $file['size'][0] : $file['size'];
// Check if file type is allowed (feature for project settings?)
if (!$fileType->isValid($file['tmp_name'])) {
throw new Exception('File type not allowed', 400);
}
// if (!$fileType->isValid($file['tmp_name'])) {
// throw new Exception('File type not allowed', 400);
// }
if (!$fileSize->isValid($file['size'])) { // Check if file size is exceeding allowed limit
throw new Exception('File size not allowed', 400);