Skip to content

Commit 40dc20a

Browse files
committed
fix(*): 修复客户端屏蔽原始图像名称无法获取文件后缀情况下报错
1 parent 1064bf3 commit 40dc20a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/FileStorage/Filesystems/AliyunOss/FileMeta.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function getSize(): int
105105
*/
106106
public function getMimeType(): string
107107
{
108-
return MimeTypes::getMimetype($this->resource->getPath());
108+
return MimeTypes::getMimetype($this->resource->getPath()) ?: 'application/octet-stream';
109109
}
110110

111111
/**

app/FileStorage/Filesystems/Local/FileMeta.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function getMimeType(): string
131131
{
132132
return $this->filesystem->mimeType(
133133
$this->resource->getPath()
134-
);
134+
) ?: 'application/octet-stream';
135135
}
136136

137137
/**

0 commit comments

Comments
 (0)