|
@@ -20,7 +20,8 @@ class UploadController extends Controller
|
|
// $type=$request->file('image')->getClientMimeType();
|
|
// $type=$request->file('image')->getClientMimeType();
|
|
// //获取文件的绝对路径,但是获取到的在本地不能打开
|
|
// //获取文件的绝对路径,但是获取到的在本地不能打开
|
|
$filePath = $request->file('image')->getRealPath();
|
|
$filePath = $request->file('image')->getRealPath();
|
|
- if (in_array($kuoname, ['jpg', 'gif', 'png'])) {
|
|
|
|
|
|
+ Log::debug('文件类型'.$kuoname);
|
|
|
|
+ if (in_array($kuoname, ['jpg', 'jpeg', 'gif', 'png'])) {
|
|
$width = Image::make($filePath)->width();
|
|
$width = Image::make($filePath)->width();
|
|
$height = Image::make($filePath)->height();
|
|
$height = Image::make($filePath)->height();
|
|
//要保存的文件名 时间+扩展名
|
|
//要保存的文件名 时间+扩展名
|
|
@@ -49,8 +50,9 @@ class UploadController extends Controller
|
|
for ($i = 0; $i < $fileCount; $i++) {
|
|
for ($i = 0; $i < $fileCount; $i++) {
|
|
$kuoname = $files[$i]->getClientOriginalExtension();
|
|
$kuoname = $files[$i]->getClientOriginalExtension();
|
|
$filePath = $files[$i]->getRealPath();
|
|
$filePath = $files[$i]->getRealPath();
|
|
|
|
+ Log::debug('文件类型'.$kuoname);
|
|
//要保存的文件名 时间+扩展名
|
|
//要保存的文件名 时间+扩展名
|
|
- if (in_array($kuoname, ['jpg', 'gif', 'png'])) {
|
|
|
|
|
|
+ if (in_array($kuoname, ['jpg', 'jpeg', 'gif', 'png'])) {
|
|
$width = Image::make($filePath)->width();
|
|
$width = Image::make($filePath)->width();
|
|
$height = Image::make($filePath)->height();
|
|
$height = Image::make($filePath)->height();
|
|
//要保存的文件名 时间+扩展名
|
|
//要保存的文件名 时间+扩展名
|