The File object is a JavaScript object with set of properties. All properties are read only. This object is returned by couple of JavaScript methods and as a parameter of event handlers.
Examples:
List of properties
Property name | Type | Description |
---|---|---|
id | string | The unique identifier of the file. This property is very usefull when order(indexes) of files is changed because of a sorting. |
index | Number | The index of the file in the upload queue. |
name | string | The name of the file on the local disk. |
type | string | The file type. In Windows, this property is the file extension. On the Macintosh, this property is the four-character file type, which is only used in Mac OS versions prior to Mac OS X. |
size | Number | The size of the file on the local disk in bytes. |
creator | string | The Macintosh creator type of the file, which is only used in Mac OS versions prior to Mac OS X. In Windows, this property is null. |
creationDate | Date | The creation date of the file on the local disk. |
modificationDate | Date | The date that the file on the local disk was last modified. |
fieldName | string | The field name that precedes the file data in the upload POST operation. By default, the value of fieldName is "Filedata" |
statusString | string | The formatted status string of the file. See fileStatusXXXMsg properties for more information. |
status | Number |
The status of the file. Possible values are:
|
serverResponse | string | The raw data returned from the server after a successful file upload. |
httpStatusCode | string |
The HTTP status code returned by the server. Possible values are:
|
width | Number | The width of image file. This property is available for ImageView only. |
height | Number | The height of image file. This property is available for ImageView only. |
resizedName | string | The name of resized image file. This property is available when ImageView is used and uploader.uploadResizedImages is set to true. |
resizedSize | Number | The size(in bytes) of resized image file. This property is available when ImageView is used and uploader.uploadResizedImages is set to true. |
resizedWidth | Number | The width of resized image file. This property is available when ImageView is used and uploader.uploadResizedImages is set to true. |
resizedHeight | Number | The height of resized image file. This property is available when ImageView is used and uploader.uploadResizedImages is set to true. |
Examples:
The following example desribes how to get all files and display their attributes:
function getFiles() { var fileObject; var queueLength = EAFlashUpload.getProperty("queue.length"); var str = ""; for(var i = 0; i < queueLength; i++) { fileObject = EAFlashUpload.getFiles(i); str += "File name: " + fileObject.name + "; "; str += "File size: " + fileObject.size; str += "<br />"; } document.getElementById("DIV_FilesInQueue").innerHTML = str; }