图片上传空格处理
This commit is contained in:
@@ -45,6 +45,9 @@ class UploadFile extends Upload
|
|||||||
$fileName = $pinyin->permalink($fileName, ''); // 转换为无分隔符的拼音
|
$fileName = $pinyin->permalink($fileName, ''); // 转换为无分隔符的拼音
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 去除文件名中的空格
|
||||||
|
$fileName = str_replace(' ', '', $fileName);
|
||||||
|
|
||||||
// 添加唯一标识符(时间戳+随机数)
|
// 添加唯一标识符(时间戳+随机数)
|
||||||
$uniqueId = time() . mt_rand(1000, 9999);
|
$uniqueId = time() . mt_rand(1000, 9999);
|
||||||
$objectName = $fileName . '_' . $uniqueId . '.' . $extension;
|
$objectName = $fileName . '_' . $uniqueId . '.' . $extension;
|
||||||
|
|||||||
Reference in New Issue
Block a user