What does this return for the .gif ? http://mime.ritey.com/
Aug 3, 2015
7
Level 1
Laravel validation mime type errors
So I am trying to make an upload form that validates images, .jpg, .png, .gif.
if (Input::hasFile('files')) {
$files = Input::file('files');
foreach($files as $file) {
$validator = Validator::make(
array('file' => $file),
array('file' => 'required|mimes:jpeg,png,gif|image|max:5000')
);
if ($validator - > passes()) {
// passes
} else {
// fails
}
...
This seems to work fine for .jpg, .png and animated gifs, but when uploading a .gif that doesn't animate the validator fails. Not sure what's going on.
Just started using Laravel, any information would be appreciated.
Please or to participate in this conversation.