skipping file type validation for now
This commit is contained in:
parent
71a69a1dd8
commit
3c4ba79103
1 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue