我一直在嘗試使用codeigniter文件上傳庫上傳多個圖像。一切正常,除非它不保存目錄中的圖像, 我有檢查權限一切都很完美。我也試過改變軟件包,但仍面臨同樣的問題。Codeigniter文件上傳錯誤
這是我上傳的代碼。
$count = count($_FILES['upload_' . $increment]['size']);
for ($s = 0; $s <= $count-1; $s++) {
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png|jpeg';
$config['max_size'] = '10000';
$config['max_width'] = '2048';
$config['max_height'] = '1152';
$image = $config['file_name'] = $c_id . '-' . $s . '.jpg';
$this->load->library('upload', $config);
$this->upload->initialize($config);
$this->upload->do_upload();
$data = $this->upload->data();
$data = array('c_id' => $c_id, 'image'=> $image);
$this->db->insert('images', $data);
}
$increment++;
也許這將工作'$配置[「upload_path」] =「./assets/uploads /」;' – devpro
我已經確定比刪除點的父目錄 –
上傳文件夾路徑 – devpro