nsIDownload

IID:9e1fd9f2-9727-4926-85cd-f16c375bba6d
Inherits From:nsITransfer

This interface is implemented by the following components:


Properties

readonly PRUint64 amountTransferred

The amount of kbytes downloaded so far.

readonly nsICancelable cancelable

Object that can be used to cancel the download. Will be null after the download is finished.

readonly PRUnichar* displayName

The user-readable description of the transfer.

readonly nsIMIMEInfo MIMEInfo

Optional. If set, it will contain the target's relevant MIME information. This includes it's MIME Type, helper app, and whether that helper should be executed.

readonly PRInt32 percentComplete

The percentage of transfer completed. If the file size is unknown it'll be -1 here.

readonly PRUint64 size

The size of file in kbytes. Unknown size is represented by 0.

readonly nsIURI source

The source of the transfer.

readonly PRInt64 startTime

The time a transfer was started.

readonly nsIURI target

The target of the transfer.

readonly nsILocalFile targetFile

The target of a download is always a file on the local file system.


References

This interface is passed as an argument to the following methods:

nsIDownloadProgressListener.onLocationChange, nsIDownloadProgressListener.onProgressChange, nsIDownloadProgressListener.onSecurityChange, nsIDownloadProgressListener.onStateChange, nsIDownloadProgressListener.onStatusChange

This interface is returned from the following methods:

nsIDownloadManager.addDownload, nsIDownloadManager.getDownload

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
September 17, 2005, 3:32 pm trev at gtchat dot de
In Gecko 1.7 and later the method init() takes nsIURI instead of nsILocalFile as the second parameter (see https://bugzilla.mozilla.org/show_bug.cgi?id=24867).

Copyright © 1999 - 2005 XULPlanet.com