upload

package
v0.0.0-...-8406b6b Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2021 License: MIT 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

CheckContainExt 检查上传的文件后缀是否包含在约定的后缀配置项中

func CheckMaxSize

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

CheckMaxSize 检查文件大小是否超出最大大小限制

func CheckPermission

func CheckPermission(dst string) bool

CheckPermission 检查文件权限是否足够

func CheckSavePath

func CheckSavePath(dst string) bool

CheckSavePath 检查文件路径是否存在

func CreateSavePath

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

CreateSavePath 创建文件保存目录

func GetFileExt

func GetFileExt(name string) string

GetFileExt 获取文件后缀

func GetFileName

func GetFileName(name string) string

func GetSavePath

func GetSavePath() string

GetSavePath 获取保存路径

func SaveFile

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

SaveFile 保存文件

Types

type FileType

type FileType int
const TypeImage FileType = iota + 1

Jump to

Keyboard shortcuts

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