0
我想上傳一個文件中,應用程序文件夾存在笨AJAX文件上傳不工作
-application
相同的目錄-images
- 系統
- 其他...
我正在嘗試的代碼是
$config = array(
'upload_path' => "images",
'allowed_types' => "*",
'overwrite' => TRUE,
'max_size' => "2048000", // Can be set to particular file size , here it is 2 MB(2048 Kb)
'max_height' => "768",
'max_width' => "1024",
);
if(isset($_FILES["image"]["name"])) {
if (0 < $_FILES['image']['error']) {
echo 'Error Occurred During Upload Of File ' . $_FILES['image']['error'];
} else {
$this->load->library('upload', $config);
if(!$this->upload->do_upload('image')) {
echo $this->upload->display_errors(); //ALWAYS THIS LINE IS EXECUTING
}
else {
echo "FILE UPLOADED";
}
}
} else {
echo "Please Select A File";
}
問題是,總是行內有評論裏面如果正在執行,它說<p>The upload path does not appear to be valid.</p>
。
當我試圖檢查該目錄是否存在使用is_dir時,它也表示該目錄存在,我也試圖給它777文件的權限,但仍然收到相同的錯誤。我也在網上嘗試了大部分類似的答案,但都沒有成功。
請幫助
這裏是明顯的例子[點擊此鏈接(https://stackoverflow.com/questions/8664758/the-upload-path-does-沒有出現是有效的codeigniter文件上傳不工作) –
https://stackoverflow.com/questions/8664758/the-upload-path-does-not-appear-to-be-valid -codeigniter-file-upload-not-worki檢查上述鏈接一次。 –
在配置後的圖像放在斜線例如:'images /' – sekaraja