advanced-nova-media-library icon indicating copy to clipboard operation
advanced-nova-media-library copied to clipboard

Issues with jpg files on Laravel 8

Open vbezruchkin opened this issue 3 years ago • 6 comments

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

vbezruchkin avatar Oct 21 '20 16:10 vbezruchkin

Hello. I ǘe the same issue. Where did you put
$result = $this->validateMimes($attribute, $value, ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'svg', 'webp']); in Nova??

mpoma avatar Nov 30 '20 22:11 mpoma

I am also facing the same problem.

manojo123 avatar Dec 01 '20 03:12 manojo123

same issue there. This is because of : https://laravel.com/docs/8.x/validation#rule-image

rikless avatar Dec 01 '20 11:12 rikless

Drastic image Delete the rule 'images' in $defaultValidatorRules

mpoma avatar Dec 01 '20 15:12 mpoma

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.

abishekrsrikaanth avatar Dec 01 '20 16:12 abishekrsrikaanth

YES!!! Gracias!

mpoma avatar Dec 01 '20 16:12 mpoma