当代码移动到另一台笔记本电脑时上传多个图像显示错误
Upload Multiple Image when code moved to another laptop it shows error
我尽我最大的努力在我的第一台笔记本电脑上调试这段代码并成功地解决了它但是现在当我将它移到另一台笔记本电脑时它突然开始再次显示一些错误我无法理解为什么。
控制器
public function uploadCollateralImage_Front()
{
$config['upload_path'] = './uploads/files';
$config['allowed_types'] = 'gif|jpg|jpeg|png';
$config['max_size'] = '2408';
$config['max_width'] = '2408';
$config['max_height'] = '2408';
$this->load->library('upload', $config);
if ( !$this->upload->do_upload('userfile1')){
$error = array('error'.'hey' => $this->upload->display_errors());
var_dump( $error); die;
}else{
$fileName = $this->upload->data();
$post_image = $fileName['file_name'];
// var_dump($post_image); die;
return $post_image;
}
}
查看
<?php
$attributes = array('name' => 'applicationform');
$hidden = array('userfile1' => 'userfile1');
echo form_open_multipart("Client_Dashboard/applicationPost",$attributes, $hidden);
?>
前视图像
<input type="file" name="userfile1" class="w3-margin-left w3-col s10 w3-teal w3-medium w3-hover-white w3-wide " required/>
和我的主要方法
public function applicationPost(){
$data_vehicleinformation = array();
$data_vehicleinformation['FrontImage'] = $this->uploadCollateralImage_Front();
check_insert_user = $this->foo_app->apply_loan($data_log, $data_user,
$data_loanapplication, $data_collateraldetails_app, $data_vehicleinformation ,
$data_paymentdetails, $data_loanpayment, $data_loanapproval,
$data_loanrequest);
}
它显示一些错误,例如
数组(1){ ["errorhey"]=> 字符串(43)“
您没有 select 要上传的文件。
“}
这完全意味着它最终没有保存在数据库中。我认为我的数据库是错误的,可能是因为排序规则或其他问题,但它不仅显示函数 uploadCollateralImage()
的错误
根据您的评论:
moved CI installation from PHP Version 5.6.23-windows8 to PHP Version
5.5.11-Windows7 Ultimate
Codeigniter 3.x 手册说:
Server Requirements
PHP version 5.6 or newer is recommended.
请检查所有服务器要求here
我尽我最大的努力在我的第一台笔记本电脑上调试这段代码并成功地解决了它但是现在当我将它移到另一台笔记本电脑时它突然开始再次显示一些错误我无法理解为什么。
控制器
public function uploadCollateralImage_Front()
{
$config['upload_path'] = './uploads/files';
$config['allowed_types'] = 'gif|jpg|jpeg|png';
$config['max_size'] = '2408';
$config['max_width'] = '2408';
$config['max_height'] = '2408';
$this->load->library('upload', $config);
if ( !$this->upload->do_upload('userfile1')){
$error = array('error'.'hey' => $this->upload->display_errors());
var_dump( $error); die;
}else{
$fileName = $this->upload->data();
$post_image = $fileName['file_name'];
// var_dump($post_image); die;
return $post_image;
}
}
查看
<?php
$attributes = array('name' => 'applicationform');
$hidden = array('userfile1' => 'userfile1');
echo form_open_multipart("Client_Dashboard/applicationPost",$attributes, $hidden);
?>
前视图像
<input type="file" name="userfile1" class="w3-margin-left w3-col s10 w3-teal w3-medium w3-hover-white w3-wide " required/>
和我的主要方法
public function applicationPost(){
$data_vehicleinformation = array();
$data_vehicleinformation['FrontImage'] = $this->uploadCollateralImage_Front();
check_insert_user = $this->foo_app->apply_loan($data_log, $data_user,
$data_loanapplication, $data_collateraldetails_app, $data_vehicleinformation ,
$data_paymentdetails, $data_loanpayment, $data_loanapproval,
$data_loanrequest);
}
它显示一些错误,例如
数组(1){ ["errorhey"]=> 字符串(43)“ 您没有 select 要上传的文件。 “} 这完全意味着它最终没有保存在数据库中。我认为我的数据库是错误的,可能是因为排序规则或其他问题,但它不仅显示函数 uploadCollateralImage()
的错误根据您的评论:
moved CI installation from PHP Version 5.6.23-windows8 to PHP Version 5.5.11-Windows7 Ultimate
Codeigniter 3.x 手册说:
Server Requirements
PHP version 5.6 or newer is recommended.
请检查所有服务器要求here