cqpCow 1 vuosi sitten
vanhempi
commit
eea8284384
1 muutettua tiedostoa jossa 8 lisäystä ja 8 poistoa
  1. 8 8
      app/Http/Controllers/Api/FileUploadController.php

+ 8 - 8
app/Http/Controllers/Api/FileUploadController.php

@@ -22,13 +22,13 @@ class FileUploadController extends BaseController
     //获取文件的位置
     public function getFile($file_name){
         $path = storage_path() . "/app/public/upload_files/".$file_name;
-        $ext = '';
-        foreach (FileUploadService::FILE_TYPE as $value){
-            if(file_exists($path. '.' . $value)){
-                $ext = $value;
-            }
-        }
-        if(empty($ext)) return '';
-        return response()->file($path.'.'.$ext);
+//        $ext = '';
+//        foreach (FileUploadService::FILE_TYPE as $value){
+//            if(file_exists($path. '.' . $value)){
+//                $ext = $value;
+//            }
+//        }
+//        if(empty($ext)) return ''; .'.'.$ext
+        return response()->file($path);
     }
 }