codeigniter - Upload Multiple Image when code moved to another laptop it shows error -
i did best debug code in first laptop , worked out when move laptop began show errors again cannot understand reason why.
controller
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; } }
view
<?php $attributes = array('name' => 'applicationform'); $hidden = array('userfile1' => 'userfile1'); echo form_open_multipart("client_dashboard/applicationpost",$attributes, $hidden); ?>
front-view image <input type="file" name="userfile1" class="w3-margin-left w3-col s10 w3-teal w3-medium w3-hover-white w3-wide " required/>
and main method
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); }
it show error like
array(1) { ["errorhey"]=> string(43) " did not select file upload. " } totally means did not end saving in database. , thought db error maybe because of collation or other matter not show error function uploadcollateralimage()
as comment:
moved ci installation php version 5.6.23-windows8 php version 5.5.11-windows7 ultimate
the codeigniter 3.x manual says:
server requirements
php version 5.6 or newer recommended.
please check server requirements here
Comments
Post a Comment