|
@@ -94,12 +94,14 @@ class Upload extends Base
|
|
|
$this->error('可执行文件禁止上传到本地服务器!');
|
|
|
}
|
|
|
$file_info = $file->getInfo();
|
|
|
- var_dump($file_info);
|
|
|
+
|
|
|
$ext = pathinfo($file_info['name'],PATHINFO_EXTENSION);
|
|
|
$file_name = pathinfo($file_info['name'],PATHINFO_FILENAME);
|
|
|
$new_name = $file_name.date("Y-m-d H:i:s").'.'.$ext;
|
|
|
- $res = move_uploaded_file($file_info['tmp_name'],'/static/pdf'.$new_name);
|
|
|
- var_dump($res,'/static/pdf'.$new_name);
|
|
|
+ $save_path = $_SERVER['DOCUMENT_ROOT'].'/static/pdf'.$new_name;
|
|
|
+ $res = move_uploaded_file($file_info['tmp_name'],$save_path);
|
|
|
+ var_dump($res,$save_path);
|
|
|
+ unlink($save_path);
|
|
|
die();
|
|
|
$headers = [];
|
|
|
$headers[] = 'Content-Type: application/x-www-form-urlencoded';
|