add .txt extension support

This commit is contained in:
2023-02-24 20:52:08 +08:00
parent 8f51e7a8dc
commit 10855d554c

View File

@@ -8,7 +8,7 @@ import (
func ValidateFilename(filename string) error {
switch filepath.Ext(filename) {
case ".pdf", ".doc", ".jpg", ".gif", ".png", ".jpeg",
".docx", ".xls", ".xlsx", ".zip", ".rar", ".7z":
".docx", ".xls", ".xlsx", ".zip", ".rar", ".7z", ".txt":
return nil
default:
return errors.New("扩展名不支持")