B
B
BonBon Slick2017-03-09 22:46:10
Laravel
BonBon Slick, 2017-03-09 22:46:10

Laravel input->file not validating?

Field:

<input type="file" name="video"  required="required">

Validation code:
'user_id' => 'required|integer',
           'video' => 'required|file', // если эта строка есть, выдает ошибку
          'title' => 'required|string|max:255',
          'description' => 'string|nullable|max:555',

Field error:
The video failed to upload.
At the same time, it comes here, this check works, and the file is there!
if($request->hasFile('video'))
            {
                dd($request->file('video'));
            }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
coderisimo, 2017-03-10
@BonBonSlick

What if something like that?

'video' => 'required|mimes:mp4,x-flv,x-mpegURL,MP2T,3gpp,quicktime,x-msvideo,x-ms-wmv'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question