web

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AllowedFileTypes  []string
	MaxUploadFileSize int
)

Functions

This section is empty.

Types

type UploadedFile

type UploadedFile struct {
	FileSize         int64
	NewFileName      string
	OriginalFileName string
}

UploadedFile is a struct used to save information about an uploaded file.

func UploadFile added in v1.3.0

func UploadFile(r *http.Request, uploadDir string, rename ...bool) (*UploadedFile, error)

UploadFile uploads one file to the specified directory with random file name. If rename is true, then original file name is use.

func UploadFiles

func UploadFiles(r *http.Request, uploadDir string, rename ...bool) ([]*UploadedFile, error)

UploadFiles uploads one or more files to the specified directory with random file names. If rename is true, then original file names are use.

Jump to

Keyboard shortcuts

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