$action(); } public function Uploadtxt() { $config = config('attachment_upload'); // 获取表单上传文件 $file = request()->file('ebook'); $info = $file->move($config['rootPath']); if ($info) { echo $config['rootPath']."/".$info->getSaveName(); } else { echo $file->getError(); } exit(); } public function Uploadzip() { $config = config('attachment_upload'); // 获取表单上传文件 $file = request()->file('ebook'); $info = $file->move(str_replace("attachment","zip",$config['rootPath'])); if ($info) { echo str_replace("attachment","zip",$config['rootPath'])."/".$info->getSaveName(); } else { echo $file->getError(); } exit(); } }