45 lines
1.1 KiB
Plaintext
45 lines
1.1 KiB
Plaintext
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | 小说系统 [ WE CAN DO IT JUST THINK IT ]
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\admin\controller;
|
|
use app\common\controller\Admin;
|
|
|
|
class Upload extends Admin {
|
|
|
|
public function _empty() {
|
|
$controller = controller('common/Upload');
|
|
$action = ACTION_NAME;
|
|
return $controller->$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();
|
|
}
|
|
} |