mardi 27 juin 2017

Different max file size for different file types?

I want to set different max file sizes for different file types, like:

  • 10 MB max file size for images (PNG, JPEG, and GIF)
  • 50 MB max file size for videos (MP4)

Right now, my validator only allows 10 MB for all file types:

$validator = Validator::make($request->all(), [
    'file' => 'required|max:10000|mimes:jpg,jpeg,png,gif,mp4',
]);

How can I set different max file sizes for different file types?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2sNTsKn
via IFTTT

Aucun commentaire:

Enregistrer un commentaire