Browse Source

upload image size

xielin 5 years ago
parent
commit
224dd3f09c
1 changed files with 3 additions and 1 deletions
  1. 3 1
      app/Http/Controllers/UploadController.php

+ 3 - 1
app/Http/Controllers/UploadController.php

@@ -25,7 +25,9 @@ class UploadController extends Controller
                 $width = Image::make($filePath)->width();
                 $width = Image::make($filePath)->width();
                 $height = Image::make($filePath)->height();
                 $height = Image::make($filePath)->height();
                 //要保存的文件名 时间+扩展名
                 //要保存的文件名 时间+扩展名
-                $filename = time() . '_' . uniqid() . '*' . $width . '_' . $height . '.' . $kuoname;
+                $filename = time() . '_' . uniqid() . '?' . $width . '_' . $height . '.' . $kuoname;
+                //todo 等待客户端更新后替换为下列规则
+                //$filename = time() . '_' . uniqid() . '.' . $kuoname . '?' . $width . '_' . $height;
             } else {
             } else {
                 //要保存的文件名 时间+扩展名
                 //要保存的文件名 时间+扩展名
                 $filename = time() . '_' . uniqid() . '.' . $kuoname;
                 $filename = time() . '_' . uniqid() . '.' . $kuoname;