Support the ongoing development of Laravel.io →
posted 10 years ago
Validation
Last updated 2 years ago.
0

I can't test now but I do believe that you can only use comma separated values

'files' => 'required|mimes:jpeg,jpg,png'

http://laravel.com/docs/validation#rule-mimes

Last updated 2 years ago.
0

Thanks for your answer, I've also tested this and it doesn't work. //edit: ok I got it, the problem was that I called the field "files[]" if I remove the [] it works. so the field must look like this:

{{ Form::file('files', array('multiple'=>true)); }}

Now the user can upload multiple files and the validation works also!

Last updated 2 years ago.
0

cherrycoding said:

Thanks for your answer, I've also tested this and it doesn't work. //edit: ok I got it, the problem was that I called the field "files[]" if I remove the [] it works. so the field must look like this:

{{ Form::file('files', array('multiple'=>true)); }}

Now the user can upload multiple files and the validation works also!

No didn't work for me and if you uploading multiple it should be files[]

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.