mirror of
https://github.com/quarkcloudio/quark-go.git
synced 2025-10-07 00:43:22 +08:00
32 lines
448 B
Go
32 lines
448 B
Go
package uploads
|
|
|
|
import (
|
|
"github.com/quarkcms/quark-go/pkg/builder/template/adminupload"
|
|
)
|
|
|
|
type File struct {
|
|
adminupload.Template
|
|
}
|
|
|
|
// 初始化
|
|
func (p *File) Init() interface{} {
|
|
|
|
// 初始化模板
|
|
p.TemplateInit()
|
|
|
|
// 限制文件大小
|
|
p.LimitSize = 1024 * 1024 * 1024 * 2
|
|
|
|
// 限制文件类型
|
|
p.LimitType = []string{
|
|
"image/jpg",
|
|
"image/jpeg",
|
|
"image/png",
|
|
"image/gif",
|
|
}
|
|
|
|
p.SavePath = "./storage/files/"
|
|
|
|
return p
|
|
}
|