|
@@ -18,16 +18,16 @@ class UploadController extends Controller
|
|
|
$filePath = $request->file('image')->getRealPath();
|
|
|
Log::debug('文件类型'.$kuoname);
|
|
|
try{
|
|
|
- if (in_array($kuoname, ['jpg', 'jpeg', 'gif', 'png'])) {
|
|
|
- $width = Image::make($filePath)->width();
|
|
|
- $height = Image::make($filePath)->height();
|
|
|
- //要保存的文件名 时间+扩展名
|
|
|
- $filename = time() . '_' . uniqid() . '.' . $kuoname;
|
|
|
- $fileurl = $filename . '?' . $width . '_' . $height;
|
|
|
- } else {
|
|
|
+// if (in_array($kuoname, ['jpg', 'jpeg', 'gif', 'png'])) {
|
|
|
+// $width = Image::make($filePath)->width();
|
|
|
+// $height = Image::make($filePath)->height();
|
|
|
+// //要保存的文件名 时间+扩展名
|
|
|
+// $filename = time() . '_' . uniqid() . '.' . $kuoname;
|
|
|
+// $fileurl = $filename . '?' . $width . '_' . $height;
|
|
|
+// } else {
|
|
|
//要保存的文件名 时间+扩展名
|
|
|
$fileurl = $filename = time() . '_' . uniqid() . '.' . $kuoname;
|
|
|
- }
|
|
|
+// }
|
|
|
$imageUrl = Storage::put($path . $filename, file_get_contents($filePath));
|
|
|
Log::debug('upload_url:' . $imageUrl);
|
|
|
if ($imageUrl) {
|