UploadFile.as

Summary
UploadFile.as
UploadFileThis class manages the files that have been uploaded.
Variables
_fileReferenceFile reference to the file to be uploaded.
_nameName of the file
_sizeSize of the file in bytes.
_statusStatus of the file upload.
Constants
Upload StatusVarious upload status settings.
Functions
UploadFileInitializes the object.
Properties
statusReturns the status of the transfer.
statusSets the transfer status and dispatches a property change event.
nameReturns the file name.
fileReturns the reference to the file on the local file system.
sizeReturns the size of the file in bytes.

UploadFile

ObjectProxy
UploadFile

This class manages the files that have been uploaded.  Extends the ObjectProxy class because it throws property change events.

Summary
Variables
_fileReferenceFile reference to the file to be uploaded.
_nameName of the file
_sizeSize of the file in bytes.
_statusStatus of the file upload.
Constants
Upload StatusVarious upload status settings.
Functions
UploadFileInitializes the object.
Properties
statusReturns the status of the transfer.
statusSets the transfer status and dispatches a property change event.
nameReturns the file name.
fileReturns the reference to the file on the local file system.
sizeReturns the size of the file in bytes.

Variables

_fileReference

private var _fileReference: FileReference

File reference to the file to be uploaded.

_name

private var _name: String

Name of the file

_size

private var _size: Number

Size of the file in bytes.

_status

private var _status: String

Status of the file upload.

Constants

Upload Status

Various upload status settings.  These are converted to numbers for the sort order.

QUEUEDFile is queued for upload
UPLOADINGFile is actively uploading
FINISHEDFile is uploaded

Functions

UploadFile

public function UploadFile(name: String,  
size: Number,  
status: String,  
file: FileReference = null)

Initializes the object.

Parameters

nameName of the file
sizeSize of the file in bytes
statusStatus of the upload, must use provided constants, values are subject to change.
fileFile reference if the file exists on the local filesystem.

Properties

status

public function get status():String

Returns the status of the transfer.

status

public function set status(value: String):void

Sets the transfer status and dispatches a property change event.

name

public function get name():String

Returns the file name.

file

public function get file():FileReference

Returns the reference to the file on the local file system.

size

public function get size():Number

Returns the size of the file in bytes.

private var _fileReference: FileReference
File reference to the file to be uploaded.
private var _name: String
Name of the file
private var _size: Number
Size of the file in bytes.
private var _status: String
Status of the file upload.
public function UploadFile(name: String,  
size: Number,  
status: String,  
file: FileReference = null)
Initializes the object.
public function get status():String
Returns the status of the transfer.
public function get name():String
Returns the file name.
public function get file():FileReference
Returns the reference to the file on the local file system.
public function get size():Number
Returns the size of the file in bytes.