问题描述:

my csv file is locally uploading perfectly but when i upload it on my website then its not uploading following is my upload function

function upload_title()

{

if(isset($_POST['upload_titles'])) // check if submit button is clicked

{

$config['upload_path'] = 'uploads/title/';

$config['allowed_types'] = 'csv';

$config['max_size'] = '5000';

$config['overwrite'] = TRUE;

$config['encrypt_name'] = TRUE;

$config['remove_spaces'] = TRUE;

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

$this->upload->initialize($config);

$this->upload->do_upload();

$temp = $this->upload->data('userfile');

$article_titlelist = $temp['file_name'];

if($this->upload->do_upload())

{

$this->load->library('csvreader');

$result = $this->csvreader->parse_file('./uploads/title/'.$article_titlelist);

foreach($result as $val)

{

$articletitle = $val['title'];

$title_category = $val['category'];

$mDate = date('Y-m-d H:i:s');

$data = array(

'article_title' => $articletitle,

'title_category' => $title_category,

'article_cdate' => $mDate,

'article_mdate' => $mDate

);

$this->article_model->addtitle($data);

}

redirect('admin/article/title_listing');

}

}

$error = array('error' => $this->upload->display_errors());

$data['page_title'] = 'Article Title';

$data['content'] = $this->load->view('admin/add_title', $error, true);

$this->load->view('admin/template', $data);

}

i have check it online its not going in do_upload condition

相关阅读:
Top