algernon: Index | Files

package upload

import ""

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


Package Files



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

func Load Uses

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

Load makes functions related to saving an uploaded file available

type UploadedFile Uses

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 Uses

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.

Package upload imports 11 packages (graph) and is imported by 1 packages. Updated 2021-01-22. Refresh now. Tools for package owners.