Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with jpg files on Laravel 8 #210

Open
vbezruchkin opened this issue Oct 21, 2020 · 6 comments
Open

Issues with jpg files on Laravel 8 #210

vbezruchkin opened this issue Oct 21, 2020 · 6 comments

Comments

@vbezruchkin
Copy link

vbezruchkin commented Oct 21, 2020

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
@mpoma
Copy link

mpoma commented Nov 30, 2020

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

@manojo123
Copy link

I am also facing the same problem.

@rikless
Copy link

rikless commented Dec 1, 2020

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

@mpoma
Copy link

mpoma commented Dec 1, 2020

Drastic
image
Delete the rule 'images' in $defaultValidatorRules

@abishekrsrikaanth
Copy link

abishekrsrikaanth commented Dec 1, 2020

This has been fixed on the latest tag of Laravel released an hour ago (laravel/framework#35419).. Composer update should fix this.

@mpoma
Copy link

mpoma commented Dec 1, 2020

YES!!! Gracias!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants