问题描述:

I am Trying to Upload two file with from Same form with Different File name.

The First File is always Uploading But the Other one never Uploading.

code for Model is:

 public function add_imgup()

{

$this->uppdf();

$this->upphoto();

}

public function upphoto()

{

$upload = array();

$current_timestamp = time();

$image_name = $current_timestamp.'_image';

$config['upload_path'] = $this->config->item('file_upload_absolute_path')."pdf/";

$config['allowed_types'] = 'pdf|PDF|DOC|doc|docx';

$config['overwrite'] = true;

$config['file_name'] = $image_name;

$this->load->library('upload',$config);

$file_image = $this->upload->do_upload('ccv');

$image = array('upload_data' => $this->upload->data());

}

public function uppdf()

{

$upload = array();

$current_timestamp = time();

$image_name = $current_timestamp.'_image';

$config['upload_path'] = $this->config->item('file_upload_absolute_path')."photo/";

$config['allowed_types'] = 'jpg|jpeg|png|gif|bmp';

$config['overwrite'] = true;

$config['file_name'] = $image_name;

$this->load->library('upload',$config);

$file_image = $this->upload->do_upload('iimg');

$image = array('upload_data' => $this->upload->data());

}

网友答案:

Check the print_r($_FILE) after submitting the form to confirm the you submitted correct form, also check your form is enctype="multipart/form-data"

相关阅读:
Top