MCPcopy Index your code
hub / github.com/TruthHun/BookStack / GetUploadFileExt

Function GetUploadFileExt

conf/enumerate.go:113–128  ·  view source on GitHub ↗

获取允许的商城文件的类型.

()

Source from the content-addressed store, hash-verified

111
112//获取允许的商城文件的类型.
113func GetUploadFileExt() []string {
114 ext := beego.AppConfig.DefaultString("upload_file_ext", "png|jpg|jpeg|gif|txt|doc|docx|pdf")
115
116 temp := strings.Split(ext, "|")
117
118 exts := make([]string, len(temp))
119
120 i := 0
121 for _, item := range temp {
122 if item != "" {
123 exts[i] = item
124 i++
125 }
126 }
127 return exts
128}
129
130//判断是否是允许商城的文件类型.
131func IsAllowUploadFileExt(ext string, typ ...string) bool {

Callers 1

IsAllowUploadFileExtFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected