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
Post a Comment