add .txt extension support
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
|||||||
func ValidateFilename(filename string) error {
|
func ValidateFilename(filename string) error {
|
||||||
switch filepath.Ext(filename) {
|
switch filepath.Ext(filename) {
|
||||||
case ".pdf", ".doc", ".jpg", ".gif", ".png", ".jpeg",
|
case ".pdf", ".doc", ".jpg", ".gif", ".png", ".jpeg",
|
||||||
".docx", ".xls", ".xlsx", ".zip", ".rar", ".7z":
|
".docx", ".xls", ".xlsx", ".zip", ".rar", ".7z", ".txt":
|
||||||
return nil
|
return nil
|
||||||
default:
|
default:
|
||||||
return errors.New("扩展名不支持")
|
return errors.New("扩展名不支持")
|
||||||
|
|||||||
Reference in New Issue
Block a user