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?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire