FriendsOfCake / cakephp-upload

CakePHP: Handle file uploading sans ridiculous automagic
https://cakephp-upload.readthedocs.io/
MIT License
551 stars 255 forks source link

Validate upload mime type #604

Closed angelxmoreno closed 11 months ago

angelxmoreno commented 11 months ago

Do we need a PR for the UploadValidationTrait to have fileIsOfMimeType? I could have sworn we had this at some point. Any reasons why it was removed?

angelxmoreno commented 11 months ago

Never mind, adding this here as context:

CakeValidation can be used:

        $validator->add('file', 'mimeType', ['foo']);

https://api.cakephp.org/4.4/class-Cake.Validation.Validation.html#mimeType()