php - File upload form validation is not working in laravel 5.1? -


i using form validation upload file in laravel 5.1,

  class fileuploadrequest extends request {     public function rules() {     return ['file' => 'required', 'max:2048', 'mimes:pdf,png,jpeg,jpg']; }    public function upload(fileuploadrequest $request) {   } 

but not validating both size , mime.. wrong me?

try modifying rules function this

public function rules() {     return [         'file' => 'required|mimes:pdf,png,jpeg,jpg|size:2048',     ]; } 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -