From 3c4ba7910335ea4cc897a2cfff65613b29021901 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 18 Jun 2021 14:20:46 +0545 Subject: [PATCH] skipping file type validation for now --- app/controllers/api/storage.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 844a90295a..075bac8225 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -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);