https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types here's a list of all mime types. You could try with
'files' => 'required|file|mimes:pdf,doc,mp4,mp3'
There's not file/pdf, it should be application/pdf
Hello guys I want to ask if my way of uploading files with type mp4, mp3, pdf.docx is correct
after i try to run it i got an error message The files must be a file of type: file / pdf, docx, video / mp4, audio / mp3.
Thank you for the help
$this->validate($request,[ 'user_id' => 'required', 'name' => 'required|string|max:255', 'email' => 'required|string|email|max:255|unique:bookings', 'phone' => 'required', 'subject' => 'required', 'do_date' => 'required', 'files' => 'required|file|mimetypes:file/pdf,docx,video/mp4,audio/mp3',
]);
$formInput = $request->except('files');
$data = $request->files;
if($data){
$dataName = $data->getClientOriginalName();
$data->move('user/bookings/', $dataName);
$formInput['files'] = $dataName;
}
Booking::create($formInput);
flash('Youre request success send')->success();
return redirect()->back();
https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types here's a list of all mime types. You could try with
'files' => 'required|file|mimes:pdf,doc,mp4,mp3'
There's not file/pdf, it should be application/pdf
Please or to participate in this conversation.