ソースを参照

修改文件上传

chenxiqiang 6 年 前
コミット
53c623e544
共有1 個のファイルを変更した2 個の追加4 個の削除を含む
  1. 2
    4
      manage-server/app/Http/Controllers/CommonController.php

+ 2
- 4
manage-server/app/Http/Controllers/CommonController.php ファイルの表示

@@ -55,10 +55,8 @@ class CommonController extends Controller
55 55
     public function upload(Request $request)
56 56
     {
57 57
         try {
58
-            $photo = $_FILES['file'];
59
-            //if ($request->hasFile('file') && $request->file('file')->isValid()) {
60
-            if ($photo){
61
-                //$photo = $request->file('file');
58
+            if ($request->hasFile('file') && $request->file('file')->isValid()) {
59
+                $photo = $request->file('file');
62 60
                 $extension = $photo->extension();
63 61
                 $path = $photo->getRealPath();
64 62
                 //$store_result = $photo->store('photo');

Loading…
キャンセル
保存