fix: 支持heic和png格式

This commit is contained in:
2024-02-12 21:15:56 +08:00
parent 686ac375f2
commit 29ea61034a

View File

@@ -9,7 +9,9 @@ import (
func ValidateFilename(filename string) error {
switch filepath.Ext(strings.ToLower(filename)) {
case ".pdf", ".doc", ".jpg", ".gif", ".png", ".jpeg",
".docx", ".xls", ".xlsx", ".zip", ".rar", ".7z", ".txt":
".docx", ".xls", ".xlsx", ".zip", ".rar", ".7z", ".txt",
// 支持 iOS 的 HEIC 格式
".heic", ".heif", "png":
return nil
default:
return errors.New("扩展名不支持")