mostafaznv's avatar

Laravel Requests

hi

i'm using laravel 5.2

i want to upload video files and i wrote a request rule like this:

return [
    'video' => 'max:50000|mimetypes:video/mp4,video/webm,video/ogg|required'
];

when i want to upload an image file, it throw an error like this:

validation.mimetypes

i checked validation.php and i didnt find anything for mimetypes.

https://github.com/laravel/laravel/blob/master/resources/lang/en/validation.php

0 likes
1 reply
usama.ashraf's avatar

@mostafaznv what is your video's extension ?

Keep this in mind:

To determine the MIME type of the uploaded file, the file's contents will be read and the framework will attempt to guess the MIME type, which may be different from the client provided MIME type.

Please or to participate in this conversation.