mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
skipping file type validation for now
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user