0
フォルダに画像を追加できません。その理由はわかりません。私は自分のルートフォルダ内に顧客フォルダを持っています。codeigniterの画像フォルダをアップロードできません
これは私のコントローラ機能である:
function add_new_successfully(){
$config['upload_path'] = site_url().'customer/';
$config['allowed_types'] = 'gif|jpg|jpeg|png';
$this->load->library('upload',$config);
$this->upload->do_upload('userfile');
$data['customer_name'] = $this->input->post('c_name');
$data['customer_email'] = $this->input->post('c_email');
$data['customer_pass'] = $this->input->post('c_pass');
$data['customer_country'] = $this->input->post('c_country');
$data['customer_city'] = $this->input->post('c_city');
$data['customer_contact'] = $this->input->post('c_contact');
$data['customer_address'] = $this->input->post('c_address');
$data['customer_image'] = $_FILES['userfile']['name'];
$this->common_model->insert('customers',$data);
$this->session->set_flashdata('page_added','<div class="n_ok"><p>Customer added</p></div>');
redirect($_SERVER['HTTP_REFERER']);
}
私の詳細はデータベースにアップロードされますが、フォルダーはありません...私は$ config ['upload_path'] = site_url() 'customer /'を変更します。 $ config ['upload_path'] = FCPATH.'customer/'に変更してください。しかし、同じ問題.... @ Tpjka –
私はあなたに提案し、そこに何か違いがあると言って 'のupload_path'を変更します。 – Tpojka
ありがとうございました........ @ Tpojka –