Php 第207行文件上载中的MethodNotAllowedException
我在RouteCollection第207行获得MethodNotAllowedException,在我的web应用程序中出现异常。 接下来,我将复制一些可能感兴趣的代码 这是视图中的表单代码Php 第207行文件上载中的MethodNotAllowedException,php,xml,laravel,Php,Xml,Laravel,我在RouteCollection第207行获得MethodNotAllowedException,在我的web应用程序中出现异常。 接下来,我将复制一些可能感兴趣的代码 这是视图中的表单代码 {!! Form::open(['url' => route('admin.mmk.listings.import'), 'files' => TRUE]) !!} <div class="modal-body"> <p>
{!! Form::open(['url' => route('admin.mmk.listings.import'), 'files' => TRUE]) !!}
<div class="modal-body">
<p>
<b>Atention</b>: for a successfull import, ensure your xml file is valid.<br />
Please, remove any "<![CDATA[<root>" and "</root>]]>" tag from your file".<br />
Check this <a href="{{ asset('resources_template.xml') }}" target="_blank">template</a> if you need help.
</p>
<p>
{!! Form::file('xml', array('accept' => '.xml')) !!}
<small>Accepted formats: xml</small>
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">Import</button>
</div>
{!! Form::close() !!}
他只需获取导入的xml文件和数据,将数据存储在数据库中,并保存来自外部网站的图像。它对于小尺寸的xml文件非常有效,但当我导入大xml文件时,我遇到了这个异常,但它仍然在数据库中插入数据
我怎样才能解决这个问题?
谢谢大家! 试试看:
{!! Form::open(['url' => route('admin.mmk.listings.import'), 'files' => TRUE, 'method' => 'post']) !!}
尝试更改路由方法。像这样:
Route::get('listings/import', array(
'as' => 'admin.mmk.listings.import',
'uses' => 'MMKController@importListings'));
如果仍然出现此错误,则表示问题不是路由方法,否则请将表单方法更改为在form::open中发布如何编辑?使用GET编辑表单,但路由是post。将该方法添加到表单请求中。
Route::get('listings/import', array(
'as' => 'admin.mmk.listings.import',
'uses' => 'MMKController@importListings'));