1
我的多圖像上傳有問題。Codeigniter多圖像上傳錯誤消息
代碼
function tester($yourUniqueId){
$this->load->library('upload');
for($i=0; $i<count($_FILES); $i++)
{
$_FILES['userfile']['name'] = $_FILES['filename']['name'][$i];
$_FILES['userfile']['type'] = $_FILES['filename']['type'][$i];
$_FILES['userfile']['tmp_name'] = $_FILES['filename']['tmp_name'][$i];
$_FILES['userfile']['error'] = $_FILES['filename']['error'][$i];
$_FILES['userfile']['size'] = $_FILES['filename']['size'][$i];
$path = './uploads/' . $yourUniqueId;
mkdir($path);
$config['file_name'] = "kep_" . $i;
$config['upload_path'] = $path;
$config['allowed_types'] = 'jpg|jpeg|png';
$config['max_size'] = '0';
$config['overwrite'] = FALSE;
$this->upload->initialize($config);
if($this->upload->do_upload())
{
$error += 0;
}else{
$error += 1;
}
}
if($error > 0){
return FALSE;
}else{
return TRUE;
}
}
它有點奇怪,因爲,它返回false,我給它的回聲
if($error > 0){
echo 'Something went wrong'; //just for a test
return FALSE;
犯規它sopose顯示回聲?
我不能讓它工作。
有沒有東西與代碼worng?
可以請別人給我一個提示? 我不能看到它的任何地方