Class com.sekati.net.File

Description

File handler class for uploading and downloading files and FileReference Events.
TODO Needs thorough testing to confirm event handling works properly.

Field Index

_allTypes, _anyType, _audioTypes, _docTypes, _flashTypes, _imageType, _textType, _videoTypes, _webTypes, creationDate, creator, modificationDate, name, onCancelEVENT, onCompleteEVENT, onHTTPErrorEVENT, onIOErrorEVENT, onOpenEVENT, onProgressEVENT, onSecurityErrorEVENT, onSelectEVENT, size, type

Method Index

new File()
browse(), download(), upload()

Inherited from CoreObject

Constructor Detail

File

public function File()

Constructor

Field Detail

_imageType

public _imageType:Object

_textType

public _textType:Object

_docTypes

public _docTypes:Object

_webTypes

public _webTypes:Object

_flashTypes

public _flashTypes:Object

_audioTypes

public _audioTypes:Object

_videoTypes

public _videoTypes:Object

_anyType

public _anyType:Object

_allTypes

public _allTypes:Array

onSelectEVENT

public onSelectEVENT:String

onCancelEVENT

public onCancelEVENT:String

onOpenEVENT

public onOpenEVENT:String

onProgressEVENT

public onProgressEVENT:String

onCompleteEVENT

public onCompleteEVENT:String

onHTTPErrorEVENT

public onHTTPErrorEVENT:String

onIOErrorEVENT

public onIOErrorEVENT:String

onSecurityErrorEVENT

public onSecurityErrorEVENT:String

creationDate

public creationDate:Date [Read Only]
file creation date

creator

public creator:String [Read Only]
macintosh creator type of the file

modificationDate

public modificationDate:Date [Read Only]
date the file was last modified on local disk

name

public name:String [Read Only]
the file name on local disk

size

public size:Number [Read Only]
the file size on local disk in bytes

type

public type:String [Read Only]
the file type

Method Detail

download

public function download(url:String, defaultFileName:String):Boolean

prompt user to save a remote file

Parameters

url(String) url of remote file

Return

Boolean - success status of download

browse

public function browse(type:Array):Boolean

Displays a file-browsing dialog box for the user to select a file to upload.

Parameters

type(Array) optional array of allowed filetypes. If none is passed the _allTypes class array will be used.

Return

Boolean - true if the dialogue box was successfully displayed.

upload

public function upload(url:String, uploadDataFieldName:String, testUpload:Boolean):Boolean

Start a file upload (100mb max is supported by the FlashPlayer). Note: On some browsers, URL strings are limited in length. Lengths greater than 256 characters may fail on some browsers or servers.

Parameters

url(String) the server url to upload file to.
testUpload(Boolean) optional 0byte upload test for windows Flashplayer only. The default is false.

Return

Boolean - false if upload fails for any reason.