0
我喜歡上傳一個文件的形式,它包含一些文本框和一個文件上傳按鈕, 如何在codeigniter中, 當我在單獨做我可以但隨着文件上傳我不能上傳文件數據和文本框,單選按鈕值到數據庫
function upload()
{
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png|txt|pdf|doc|docx';
$config['max_size'] = '1024';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
if (! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('js_home', $error);
}
else
{
$data = array('upload_data' => $this->upload->data(),'phone' =>$this->input->post('phone'),'email' =>$this->input->post('email'),'password' =>$this->input->post('password'));
$this->jobseeker->storefile($data);
$this->load->view('samples/upload_success', $data);// after uploaded the file
}
}
有任何錯誤去做 –
是否要將文件名存儲在數據庫中 –
是什麼問題?上傳完成後,您只需更新/插入數據庫。 –