我在标题中提到了错误!
但是我试图写的文件夹看起来像这样
drwxrw-rw- 2 myuser apache 4096 Oct 25 01:18 files
我不明白为什么。这是我正在编写的代码:
function upload($ext){
$data = array();
if((!empty($_FILES["importList"])) && ($_FILES['importList']['error'] == 0)) {
$filename = basename($_FILES['importList']['name']);
$fileExt = substr($filename, strrpos($filename, '.') + 1);
if (($ext == $fileExt) && ($_FILES["importList"]["size"] < 350000)) {
$newname = $_SERVER['DOCUMENT_ROOT'].'/httpdocs/files/'.$filename;
if (!file_exists($newname)) {
if ((move_uploaded_file($_FILES['importList']['tmp_name'],$newname))) {
$data['results'] = "success";
$data['filepath'] = $newname;
return $data;
} else {
$data['results'] = self::$errorMsg[8001];
return $data;
}
} else {
$data['results'] = self::$errorMsg[8002];
return $data;
}
} else {
$data['results'] = self::$errorMsg[8003];
return $data;
}
} else {
$data['results'] = self::$errorMsg[8004];
return $data;
}
}
}
从这里我得到这个错误 $errorMsg[8001],这意味着它一直到 move_upload_file() 并且失败了!由于标题中提到的错误..有人可以帮忙吗?我还需要展示什么才能找到解决方案?