欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

图像验证 有大用 Image size validation in Laravel5 图像大小 等等

In laravel5 official documentation i get validation rules here http://laravel.com/docs/5.0/validation#rule-size . For files, size corresponds to the file size in kilobytes. And according to it i make a rules for validation image file:

'property_image'         => 'mimes:jpeg,bmp,png,gif|size:200'

But its expect exactly 200K size image. So, I want min, max size or range for validation image. Is there anyway?



1 Answer 正确答案

'property_image' => 'mimes:jpeg,bmp,png,gif|max:200'

btw. there's no jpg mime, image/jpeg is proper mime type.

    来自  https://stackoverflow.com/questions/29477339/image-size-validation-in-laravel5


    image.png

    image.png

    来自 https://stackoverflow.com/questions/37432641/how-to-validate-on-max-file-size-in-laravel

    普通分类: