FileUpload

Handles file uploads via HTTP POSTs.  Handling the upload is a three-step process.  First, you need to create an instance of the class, passing it the upload array and optional destination directory and upload array index.  After that, you check if the upload completed successfully, and based on that check, either move the file to the permanent location or emit an error message.

Events

OnInitFired when the object is created.
InitCompleteFired after object is initialized.
OnMoveFired before moving the uploaded file to its destination.
MoveCompleteFired after the file is successfully moved.
Summary
FileUploadHandles file uploads via HTTP POSTs.
Functions
statusGet a status code for the file upload.
completedDetermines the status of the upload.
moveFileMoves the file from the upload directory to the permanent location.
errorMessageGets a message associated with the status of the upload.

Functions

status

function status()

Get a status code for the file upload.

Returns

An integer representing the upload status.

completed

function completed()

Determines the status of the upload.

Returns

True if the file uploaded without error, false otherwise.

moveFile

function moveFile()

Moves the file from the upload directory to the permanent location.

Retruns

True on success, false otherwise.

errorMessage

function errorMessage($err = false)

Gets a message associated with the status of the upload.

Parameters

errOptional status code for which to get the message.  The default is to use the error property of the object.

Returns

A string containing the appropriate message.

function status()
Get a status code for the file upload.
function completed()
Determines the status of the upload.
function moveFile()
Moves the file from the upload directory to the permanent location.
function errorMessage($err = false)
Gets a message associated with the status of the upload.
Close