upload

package
v0.0.0-...-5952180 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckContainExt

func CheckContainExt(t FileType, name string) bool

func CheckMaxSize

func CheckMaxSize(t FileType, f multipart.File) bool

func CheckPermission

func CheckPermission(dst string) bool

func CheckSavePath

func CheckSavePath(dst string) bool

func CreateSavePath

func CreateSavePath(dst string, perm os.FileMode) error

func GetFileExt

func GetFileExt(name string) string

func GetFileName

func GetFileName(name string) string

func GetSavePath

func GetSavePath() string

func SaveFile

func SaveFile(file *multipart.FileHeader, dst string) error

Types

type FileInfo

type FileInfo struct {
	Name      string `json:"name"`
	AccessUrl string `json:"accessUrl"`
}

type FileType

type FileType int
const (
	TypeImage FileType = iota + 1
	TypeExcel
	TypeTxt
	TypePDF
	TypeDoc
)

Jump to

Keyboard shortcuts

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