php 上传文件出现无法移动的问题
Warning: move_uploaded_file(/propic/1283240615104.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /yoyodk/www/includes/upload.php on line 37Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpsg000S' to '/propic/1283240615104.jpg' in /yoyodk/www/includes/upload.php on line 37
错误信息。。。
下面是我的类代码(上传到其他空间就不出错,这个空间就有问题了)。。。
<?php
class Upload implements IUpload {
public $allowType = array('.jpg','.gif','.png','.txt','.rar','.doc','.exe','.zip','.log');
public $allowSize = 5120000;//500kb
private $file = null;
private $fileExtension = null;
private $fileSize = null;
private $fileName = null;
private $uploadPath = null;
public function __construct( $inputName , $uploadPath ){
$this->file = $_FILES[$inputName];
$this->uploadPath = $uploadPath;
$this->fileExtension = strtolower(strrchr($this->file[name],"."));
$this->fileSize = $this->file[size];
$this->fileName = $this->getFileName();
}
public function _upload(){
if($this->fileSize > $this->allowSize){
$this->Err("上传的文件过大,上传文件的大小不得超过{$this->allowSize}");
}
if(!in_array( $this->fileExtension , $this->allowType )){
$this->Err("上传文件类型错误,请上传\"" . implode( "," , $this->allowType) . "\"!" );
}
if(!file_exists( ROOT . "/" . $this->uploadPath )){
$this->createDir(ROOT . "/" . $this->uploadPath);
}
if(!move_uploaded_file( $this->file[tmp_name] , "/" . $this->uploadPath . "/" . $this->fileName )){
//$this->Err("上传失败请重试!" );
exit;
}
return true;
}
public function getUploadedPath(){
return "/".$this->uploadPath . "/" . $this->fileName;
}
private function createDir($dir, $mode = 0777){
if (is_dir($dir) || @mkdir($dir,$mode)) return TRUE;
if (!$this->createDir(dirname($dir),$mode)) return FALSE;//用递归创建多层目录
return @mkdir($dir,$mode);
}
private function getFileName(){
return time() . rand(100,900) . $this->fileExtension;
}
private function Err($msg){
global $js;
$js->Alert($msg);
$js->Back();
}
}
?>
追问:那些权限是通过服务器操作人员更改还是我写程序更改。