Documentation ¶
Index ¶
- func PathExists(path string) (bool, error)
- func TokeMake(maps map[string]interface{}) (string, error)
- func TokenDeCode(str string) (map[string]interface{}, error)
- type PutRet
- type QiNiu
- type Size
- type Stat
- type UploadFile
- func (c *UploadFile) Check() (bool, error)
- func (c *UploadFile) GetLocalTmpPath() string
- func (c *UploadFile) LocalSaveFile(file multipart.File, path, file_name string) (bool, error)
- func (c *UploadFile) LocalTmpFileRemove() error
- func (c *UploadFile) SaveDataBase(maps map[string]interface{})
- func (c *UploadFile) SetConfig(mod string) (bool, error)
- func (c *UploadFile) SetUploadFileData(upload_type string, file multipart.File, header *multipart.FileHeader) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type UploadFile ¶
type UploadFile struct { NameOriginal string `json:"name_original" name:"保存的文件名"` Name string `json:"name" name:"原文件名"` Path string `json:"path" name:"文件路径"` Size int `json:"size" name:"文件大小"` Ext string `json:"ext" name:"文件后缀"` Md5 string `json:"md5" name:"md5"` Http string `json:"http" name:"图片http地址"` AttachmentId int `json:"attachment_id" name:"attachment_id"` Id int `json:"attachment_id" name:"id"` Url string `json:"url" name:"完整地址"` Config *conf.Upload `json:"-"` Attachment *models.Attachment `json:"-"` }
上传成功后返回结构体
func NewUploadFile ¶
func NewUploadFile() *UploadFile
func (*UploadFile) LocalSaveFile ¶
本地保存
func (*UploadFile) SaveDataBase ¶
func (c *UploadFile) SaveDataBase(maps map[string]interface{})
保存到数据库
func (*UploadFile) SetUploadFileData ¶
func (c *UploadFile) SetUploadFileData(upload_type string, file multipart.File, header *multipart.FileHeader) (bool, error)
文件基本数据填充 @upload_type 上传配置
Click to show internal directories.
Click to hide internal directories.