浏览代码

修改文件上传

chenxiqiang 6 年前
父节点
当前提交
16cf8d7b14
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3
    1
      manage-server/app/Http/Controllers/CommonController.php

+ 3
- 1
manage-server/app/Http/Controllers/CommonController.php 查看文件

54
     public function upload(Request $request)
54
     public function upload(Request $request)
55
     {
55
     {
56
         try {
56
         try {
57
-            if ($request->hasFile('file') && $request->file('file')->isValid()) {
57
+            $photo = $_FILES['file'];
58
+            //if ($request->hasFile('file') && $request->file('file')->isValid()) {
59
+            if ($photo){
58
                 $photo = $request->file('file');
60
                 $photo = $request->file('file');
59
                 $extension = $photo->extension();
61
                 $extension = $photo->extension();
60
                 $path = $photo->getRealPath();
62
                 $path = $photo->getRealPath();

Loading…
取消
保存