0
votes

I am trying to upload svg from laravel and it is giving this error.

The icon must be a file of type: png, svg, gif, jpeg.

This is the code of validator.

$rules = array(
    'image' => 'mimes:png,gif,svg,jpeg|max:10000' // max 10000kb
);
1
did u try juest: mimes:jpeg,png,jpg,gif,svg? - Adam Kozlowski
Yes tried same error coming. - Waseem Bashir
You need to get in the habit of accepting answers which help you to solve your issues. You'll earn points and others will be encouraged to help you. - Jay Blanchard

1 Answers

0
votes

You can use the

$rules = array( 'image' => 'image' );

It supports jpeg, png, bmp, gif, or svg file type.

Check this for more info. https://laravel.com/docs/5.4/validation#rule-image