mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-05-09 05:21:25 +08:00
[fix] 修复安全问题
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
"pandax/kit/biz"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"sync"
|
||||
)
|
||||
@@ -130,3 +131,13 @@ func SaveUploadedFile(file *multipart.FileHeader, dst string) error {
|
||||
_, err = io.Copy(out, src)
|
||||
return err
|
||||
}
|
||||
|
||||
func IsExcl(fpath string) bool {
|
||||
ext := filepath.Ext(fpath)
|
||||
switch ext {
|
||||
case "xls", "xlsx":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user