Level 2
Solved, i ve just to change the:
upload_max_filesize parameter
in the
php.ini file.
1 like
Hi all,
I've a strange problem with "max" rule validation in my FormRequestValidation.
This is my form:
{!! Form::open(['route' => [$route . '::upload', $person->id], 'files' => true, 'id' => 'form']) !!}
<div class="row">
<div class="form-group col-sm-12">
{!! Form::label('name', 'Nome') !!}
{!! Form::text('name', null, ['class' => 'form-control', 'pattern' => '[a-zA-Z\s]+', 'required' => "true", 'placeholder' => "Nome dell'allegato"]) !!}
</div>
</div>
<div class="row">
<div class="form-group col-sm-12">
{!! Form::label('file', 'File') !!}
{!! Form::file('file', ['required' => "true"]) !!}
</div>
</div>
<div class="row">
<div class="form-group col-sm-12">
{!! Form::label('description', 'Descrizione') !!}
{!! Form::textarea('description', null, ['class' => 'form-control', 'rows' => 3, 'placeholder' => "Descrizione dell'allegato"]) !!}
</div>
</div>
{!! Form::close() !!}
And in UploadAttachmentRequest i've these rules:
public function rules()
{
return [
'name' => ['required', 'regex:/[a-zA-Z\s]+/'],
'file' => 'required|max:3000'
];
}
Now if i try to upload a file bigger than 3000 KB the error that come back is coming from the 'file' => 'required' rule but not from the max rule. In fact i get back the message: "file is a required field".
how it is possibile?
thank you
Please or to participate in this conversation.