upload

package
v0.0.0-...-23c13d2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckNotExist

func CheckNotExist(src string) bool

查文件是否存在

func CheckPermission

func CheckPermission(src string) bool

检查文件是否有权限

func GetExt

func GetExt(fileName string) string

获取文件类型

func GetSize

func GetSize(f multipart.File) (int, error)

获取文件大小

func IsNotExistMkDir

func IsNotExistMkDir(src string) error

如果目录不存在,则创建一个目录

func MkAll

func MkAll(src, filename string) error

创建文件

func MkDir

func MkDir(src string) error

创建目录

func MustOpen

func MustOpen(fileName, filePath string) (*os.File, error)

打开文件

func Open

func Open(name string, flag int, perm os.FileMode) (*os.File, error)

根据特定模式打开文件

func RandomStr

func RandomStr(length int) string

随机生成符串

Types

type Field

type Field struct {
	Field      multipart.File
	Header     *multipart.FileHeader
	Size       int64
	Path       string
	PathPrefix string
	Url        string
	Name       string
	Ext        string
}

func NewFiled

func NewFiled(f multipart.File, h *multipart.FileHeader, prefix string) *Field

func (*Field) AcWriteFile

func (f *Field) AcWriteFile() error

func (*Field) AcWriteImage

func (f *Field) AcWriteImage() error

func (*Field) CheckFieldSize

func (a *Field) CheckFieldSize() bool

func (*Field) CheckFileExt

func (a *Field) CheckFileExt() bool

func (*Field) CheckImage

func (a *Field) CheckImage() error

检查图

func (*Field) CheckImageExt

func (a *Field) CheckImageExt() bool

检查图片后缀

func (*Field) CheckImageSize

func (a *Field) CheckImageSize() bool

检查图片大小

Jump to

Keyboard shortcuts

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