我对拉拉维尔有一个奇怪的问题。我正在处理一个包含文件上传的项目。除了我机器上的一个 PDF 文件外,一切正常。有了那个pdf文件,我得到了一个TokenMismatchException。我在其他项目上尝试了它,但出现了完全相同的错误。
这是我的 HTML:
<form method="POST" action="" enctype="multipart/form-data">
{!! csrf_field() !!}
<div class="form-group{{ $errors->has('file') ? ' has-error' : '' }} row">
<label class="col-md-2 control-label" for="file">Bestand</label>
<div class="col-md-4">
<input type="file" name="file">
@if ($errors->has('file'))
<span class="help-block">
<strong>{{ $errors->first('file') }}</strong>
</span>
@endif
</div>
</div>
<div class="row">
<div class="pull-right">
<button type="submit" class="btn btn-primary btn-orange">
Opslaan
</button>
</div>
</div>
</form>
这是我的路线:
Route::post('footer-toevoegen', function () {
dd('Request::all());
});
和pdf:
这里
你能检查一下 php.ini 配置吗?
PHP.ini
post_max_size=20M
upload_max_filesize=20M