我使用codeigniter制作了一个应用程序,几天前一切都很好。但突然间,昨天,当我运行应用程序时,当我从包含enctype="multipart/form data"的表单提交数据时,我遇到了错误。控制器接收到空数据。当我删除enctype时,一切都很好,但由于图像上传,我不得不将enctype保留在一些表单标签中。
<form action="<?= site_url('nasty_v2/dashboard/uploadPaid?key=').$this->my_func->scpro_encrypt("betul"); ?>" method="POST" role="form" enctype="multipart/form-data">
<div class="portlet box purple-sharp">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-image"></i>Upload Payment Proof For
</div>
</div>
<div class="portlet-body flip-scroll" align="center">
<span style = "color : #b706d6;"><h2><strong>#<?= (120000+$orid); ?></strong></h2></span>
<div class="form-group">
<div class="fileinput fileinput-new" align="center" data-provides="fileinput">
<div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 200px; height: 150px; line-height: 150px;"></div>
<div>
<span class="btn red btn-outline btn-file">
<span class="fileinput-new"> Select image </span>
<span class="fileinput-exists"> Change </span>
<input type="hidden" value="" name="title"><input type="file" name="fileImg"> </span>
<a href="javascript:;" class="btn red fileinput-exists" data-dismiss="fileinput"> Remove </a>
</div><div class="clearfix"> </div><button type="submit" class="btn btn-primary btn-circle"><i class="fa fa-upload"> Submit</i></button>
</div>
</div>
</div>
<input type="hidden" name="or_id" id="inputOr_id" class="form-control" value="<?= $or_id; ?>">
</div>
</form>
我使用Telerik Fiddler 2检查了HTTP请求,发现表单在请求中成功提交了数据,但数据没有到达控制器。应该是什么问题?
这可能是由文件上传引起的。尝试设置以下
ini_set('max_file_uploads',1000);
ini_set('post_max_size','5000M');
ini_set('upload_max_filesize','5000M');
//or php.ini file