wupengfei 2 years ago
parent
commit
1039aa15d6
1 changed files with 2 additions and 1 deletions
  1. 2 1
      application/api/controller/Upload.php

+ 2 - 1
application/api/controller/Upload.php

@@ -94,10 +94,11 @@ 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($_SERVER['DOCUMENT_ROOT'].'/static/pdf'.$new_name);
+        $res = move_uploaded_file($file_info[''],$_SERVER['DOCUMENT_ROOT'].'/static/pdf'.$new_name);
         var_dump($res,$_SERVER['DOCUMENT_ROOT'].'/static/pdf'.$new_name);
         die();
         $headers = [];