file->move($save_dir, $this->fileName); if (empty($info)) { $this->error = $this->file->getError(); return false; } return true; } public function fetch($url, $key=null) {} /** * 删除文件 * @param $fileName * @return bool|mixed */ public function delete($fileName) { $check = strpos($fileName, '/'); if ($check !== false && $check == 0) { // 文件所在目录 $fileName = substr_replace($fileName,"",0,1); } $filePath = public_path() . "{$fileName}"; return !file_exists($filePath) ?: unlink($filePath); } /** * 返回文件路径 * @return mixed */ public function getFileName() { return $this->fileName; } }