fix扩展名可能为大写
This commit is contained in:
父節點
4048ee982b
當前提交
0dc3aed4fe
@ -3,10 +3,11 @@ package util
|
||||
import (
|
||||
"errors"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func ValidateFilename(filename string) error {
|
||||
switch filepath.Ext(filename) {
|
||||
switch filepath.Ext(strings.ToLower(filename)) {
|
||||
case ".pdf", ".doc", ".jpg", ".gif", ".png", ".jpeg",
|
||||
".docx", ".xls", ".xlsx", ".zip", ".rar", ".7z", ".txt":
|
||||
return nil
|
||||
|
載入中…
x
新增問題並參考
Block a user