public function checkRootPath($rootpath) { /* 设置根目录 */ $this->rootPath = ftp_pwd($this->link) . '/' . ltrim($rootpath, '/'); if (!@ftp_chdir($this->link, $this->rootPath)) { $this->error = '上传根目录不存在!'; return false; } return true; }