Documentation ¶
Index ¶
- Variables
- func IsImage(f multipart.File, header *multipart.FileHeader) ([]byte, bool, error)
- func IsOutOfLength(c *gin.Context) bool
- func NewFileName(fileName string) string
- func Save(path string, fileName string, data []byte) error
- func SaveImage(path string, param string, c *gin.Context) (int, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorMediaType = errors.New(http.StatusText(http.StatusUnsupportedMediaType)) OutOfContentLength = errors.New(http.StatusText(http.StatusRequestEntityTooLarge)) MaxFileSize int64 = 1024 * 1024 )
View Source
var ImageType = map[string]string{
"image/gif": ".gif",
"image/jpeg": ".jpg",
"image/png": ".png",
"image/svg+xml": ".svg",
}
View Source
var TextType = map[string]string{
".htm": "text/html; charset=utf-8",
".html": "text/html; charset=utf-8",
".pdf": "application/pdf",
".xml": "text/xml; charset=utf-8",
}
Functions ¶
func IsOutOfLength ¶
func NewFileName ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.