upload

package
v0.0.0-...-75d2a66 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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 IsImage

func IsImage(f multipart.File, header *multipart.FileHeader) ([]byte, bool, error)

func IsOutOfLength

func IsOutOfLength(c *gin.Context) bool

func NewFileName

func NewFileName(fileName string) string

func Save

func Save(path string, fileName string, data []byte) error

func SaveImage

func SaveImage(path string, param string, c *gin.Context) (int, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL