您好,我有這個代碼從工作完全正常本地主機..上傳目標文件夾似乎不可寫。笨HMVC
function importcsv_attendance() {
$data['addressbook'] = $this->CSVimportModule_Model->get_addressbook_att();
$data['error'] = '';
//initialize image upload error array to empty
$config['upload_path'] = './uploads/csv/';
$config['allowed_types'] = 'csv';
$config['max_size'] = '1000';
$this->load->library('upload', $config);
// If upload failed, display error
if (!$this->upload->do_upload()) {
$data['error'] = $this->upload->display_errors();
$data['content_view'] = 'CSVimportModule/attendance';
$this->templates->admin_template($data);
} else {
$file_data = $this->upload->data();
$file_path = './uploads/csv/'.$file_data['file_name'];
if ($this->csvimport->get_array($file_path)) {
$csv_array = $this->csvimport->get_array($file_path);
foreach ($csv_array as $row) {
$insert_data = array(
'ID_NUM' => $row['ID_NUM'],
'DATE' => $row['DATE'],
'TIME_IN' => $row['TIME_IN'],
'TIME_OUT' => $row['TIME_OUT'],
'BREAK_IN' => $row['BREAK_IN'],
'BREAK_OUT' => $row['BREAK_OUT'],
'TOTAL_TIME'=> $row['TOTAL_TIME'],
);
$this->CSVimportModule_Model->insert_csv_att($insert_data);
}
$this->session->set_flashdata('success', 'CSV Data Imported Succesfully!');
redirect(base_url().'CSVimportModule/attendance');
} else
$data['error'] = "Error occured";
$data['content_view'] = 'CSVimportModule/attendance';
$this->templates->admin_template($data);
}
}
,但是當我上傳的代碼到服務器,我有這個錯誤 The upload path does not appear to be valid.
。該服務器是Linux。我已經檢查過是否有要上傳的文件夾。有一個現有的文件夾,但是,我仍然有這個錯誤。我也試圖把整個網址放在文件路徑上,但仍然是同樣的錯誤。
檢查該文件夾滲透改變滲透到777 –
怎麼做呢?我在哪裏可以找到? –
轉到您的FTP並右鍵單擊您將在其中找到的文件夾。還刪除了*。/ upload * to * upload/directory_name * –