MultiPowUpload 3.4
ListItem
  Home page
Contact support

ListItem object

 This class represents individual file added to MultiPowUpload list. All properties are read-only.

id (ListItem.id property)

id: String [read-only]

Unique identificator.

name (ListItem.name property)

name: String [read-only]

The name of the file on the local disk. Only file name, without path. Unfortunately, it is impossible to get file path due to Adobe Flash security policy.

size (ListItem.size property)

size: Number [read-only]

The size of the file on the local disk, in bytes.

uploadSize (ListItem.size property)

size: Number [read-only]

The upload size of the file in bytes. It is the size of original file, size of original file plus size of the thumbnail or only thumbnail size, depending on upload mode.

uploadThumbnailSize (ListItem.size property)

size: Number [read-only]

The size of image thumbnail in bytes.

creationDate (ListItem.creationDate property)

creationDate: Date [read-only]

The creation date of the file on the local disk.

modificationDate (ListItem.modificationDate property)

modificationDate: Date [read-only]

The date when the file was last modified on the local disk.

type(ListItem.type property)

type: String [read-only]

The file type. In Windows, this property is the file extension. On the Macintosh, this property is the four-character file type.

creator (ListItem.creator property)

creator: String [read-only]

The Macintosh creator type of the file. In Windows, this property is null.

exif (ListItem.exif property)

exif: Array [read-only]

Exif info extracted from image file. Exif info is loaded only when onImageLoaded event fired. MultiPowUpload can extract exif from images compliant with EXIF 2.2 standard. JFIF standard is not supported.

Exif properties
Propertie name

Description

name

Exif tag name

value

Value of exif tag

type

Type of exif tag

tagID

Tag idententificator

Example

	function MultiPowUpload_onImageLoaded(file)
	{
		var exifArr = file.exif;
		for(var i=0;i< exifArr.length;i++)
			alert(exifArr[i].name+" - "+exifArr[i].value+" - "+exifArr[i].type+" - "+exifArr[i].tagID);
	}

status (ListItem.status property)

status: Integer [read-only]

It is a number that represents current status of file. Possible values are listed below:

Status constants
Value

Name

Description

0

STATUS_READY

File is ready for processing.

1

STATUS_INPROGRESS

File is currently uploaded/downloaded.

2

STATUS_COMPLETE

File was sucessfully uploaded/downloaded.

3

STATUS_CANCELLED

File upload/download process was cancelled.

4

STATUS_ERROR

Error was occured while uploading/downloading the file.

percentDone (ListItem.percentDone property)

percentDone: Number [read-only]

Upload percent of this file.

Example

	function MultiPowUpload_onProgress(file) 
	{
		alert("Current file progress: "+file.percentDone);
	}

serverResponse (ListItem.serverResponse property)

serverResponse: String [read-only]

Server reply as a string. Populated only after onServerResponse event was fired for this file.

Example

	function MultiPowUpload_onServerResponse(file)
	{			
			alert("Reply for file: "+file.name+"\r\n"+file.serverResponse);
	}

postFields (ListItem.postFields property)

postFields: String[] [read-only]

Associative array of custom post fields specific for this file.
The array also contains the values entered by a user in Description window and from inline text input in List or Thumbnails view.

Example

		//get first file in the list
		var fields = MultiPowUpload.getFiles()[0].postFields;
		for (var fieldName in fields)
			alert(fieldName+" - "+fields[fieldName]);

isValidImage (ListItem.isValidImage property)

isValidImage: Boolean [read-only]

True if image file have valid size and format for thumbnails upload. Contain correct value only if image was loaded into memory (onImageLoaded event handler)

thumbnailFileName (ListItem.thumbnailFileName property)

thumbnailFileName: String [read-only]

Name of image thumbnail after replacing of all placeholders in value of thumbnail.fileName parameter. Thumbnail is uploaded to server with that name.

imageWidth (ListItem.imageWidth property)

imageWidth: Number [read-only]

Width of image file. Contain correct value only if image was loaded into memory (onImageLoaded event handler)

imageHeight (ListItem.imageHeight property)

imageHeight: Number [read-only]

Height of image file. Contain correct value only if image was loaded into memory (onImageLoaded event handler)

Example

	function MultiPowUpload_onImageLoaded(file)
	{			
			alert("Image file loaded. Width: "+file.imageWidth+",  height: "+file.imageHeight);
	}

isRemote (ListItem.isRemote property)

isRemote: Boolean [read-only]

Determines whether current ListItem object is remote file or not.

Example

	function MultiPowUpload_onFileComplete(file)
	{
		window.alert("File is remote: "+file.isRemote);
	}

URL (ListItem.URL property)

URL: String [read-only]

Url of remote file. Available only for remote files (value of isRemote property is true).

Example

	function MultiPowUpload_onFileComplete(file)
	{
		window.alert("File loaded from : "+file.URL);
	}

thumbnailUrl (ListItem.thumbnailUrl property)

thumbnailUrl: Number [read-only]

Url of thumbnail of image file. Available only for remote files (value of isRemote property is true).

Example

	function MultiPowUpload_onFileComplete(file)
	{
		window.alert("File thumbnail url : "+file.thumbnailUrl);
	}