Sfoglia il codice sorgente

修改文件上传

chenxiqiang 7 anni fa
parent
commit
16cf8d7b14
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3
    1
      manage-server/app/Http/Controllers/CommonController.php

+ 3
- 1
manage-server/app/Http/Controllers/CommonController.php Vedi File

@@ -54,7 +54,9 @@ class CommonController extends Controller
54 54
     public function upload(Request $request)
55 55
     {
56 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 60
                 $photo = $request->file('file');
59 61
                 $extension = $photo->extension();
60 62
                 $path = $photo->getRealPath();

Loading…
Annulla
Salva