advanced-nova-media-library
advanced-nova-media-library copied to clipboard
Issues with jpg files on Laravel 8
Hi, We have an issue with Images field. We can easily upload png, svg, etc. But when we try to upload .jpeg - it says a proper file is required.
All routes lead to default 'image' type validation for Images. Then it goes to default laravel validateMimes function.
When I add jpg there, it starts to work:
$result = $this->validateMimes($attribute, $value, ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'svg', 'webp']);
I'm not sure if it's Laravel topic as their default image field does not produce any errors.
OS | Linux |
---|---|
PHP Version | 7.4.11 |
Database | 10.3.25-MariaDB |
Laravel Version | 8.11.2 |
Nova Version | 3.12.1 |
Hello. I ǘe the same issue. Where did you put
$result = $this->validateMimes($attribute, $value, ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'svg', 'webp']); in Nova??
I am also facing the same problem.
same issue there. This is because of : https://laravel.com/docs/8.x/validation#rule-image
Drastic Delete the rule 'images' in $defaultValidatorRules
This has been fixed on the latest tag of Laravel released an hour ago (https://github.com/laravel/framework/pull/35419).. Composer update should fix this.
YES!!! Gracias!