upload

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package upload provides functions for dealing with uploading files in a fast and safe way

Index

Constants

View Source
const (
	// Class is an identifier for the UploadedFile class in Lua
	Class = "UploadedFile"
)

Variables

This section is empty.

Functions

func Load

func Load(L *lua.LState, w http.ResponseWriter, req *http.Request, scriptdir string)

Load makes functions related to saving an uploaded file available

Types

type UploadedFile

type UploadedFile struct {
	// contains filtered or unexported fields
}

UploadedFile represents a file that has been uploaded but not yet been written to file.

func New

func New(req *http.Request, scriptdir, formID string, uploadLimit int64) (*UploadedFile, error)

New creates a struct that is used for accepting an uploaded file

The client will send all the data, if the data is over the given size, if the Content-Length is wrongly set to a value below the the uploadLimit. However, the buffer and memory usage will not grow despite this.

uploadLimit is in bytes.

Note that the client may appear to keep sending the file even when the server has stopped receiving it, for files that are too large.

Jump to

Keyboard shortcuts

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