nsIDownload 编辑

Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

This interface is deprecated as of Firefox 26. Please use Downloads.jsm instead. toolkit/components/downloads/public/nsIDownload.idlScriptable This interface describes a download object. Download objects are used by the Download Manager (see nsIDownloadManager to manage files that are queued to download, being downloaded, and finished being downloaded.) Inherits from: nsITransfer Last changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0) Note: Once the download is completed, the Download Manager stops updating the nsIDownload object. Completed states are nsIDownloadManager::DOWNLOAD_FINISHED, nsIDownloadManager::DOWNLOAD_FAILED, and nsIDownloadManager::DOWNLOAD_CANCELED.

Attributes

AttributeTypeDescription
amountTransferredlong longThe number of bytes downloaded so far. Read only.
cancelablensICancelableAn object that can be used to cancel the download. Once the download is complete, this value is set to null. Read only.
displayNameAStringA user-readable description of the transfer. Read only.
idunsigned longThe ID by which the download is identified uniquely in the database - not globally unique. For example, a private download and a public one might have identical ids. Can only be safely used for direct database manipulation in the database that contains this download. Use the guid property instead for safe, database-agnostic searching and manipulation. Read only. Deprecated since Gecko 19.0
guidAStringThe guid of the download that is stored in the database. Has the form of twelve alphanumeric characters. Read only.
MIMEInfonsIMIMEInfoProvides the targets relevant MIME information, including its MIME type, helper application, and whether or not the helper should be executed automatically once the download is complete. Read only. Optional
percentCompletelongThe percentage of the file transfer that has been completed, or -1 if the file's size is unknown. Read only.
referrernsIURIThe referrer URI of the download. This is only valid for HTTP downloads, and can be null. Read only.
resumablebooleanIndicates if the download can be resumed after being paused or not. This is only the case if the download is over HTTP/1.1 or FTP and if the server supports it. Read only.
sizelong longThe total size of the file in bytes, or LL_MAXUINT if the file's size is unknown. Read only.
sourcensIURIThe source URI of the download. Read only.
speeddoubleThe downloads transfer speed in bytes per second. Read only.
startTimelong longThe time at which the transfer was started. Read only.
stateshortThe downloads current state. See nsIDownloadManager.Constants. Read only.
targetnsIURIThe target of the transfer. Read only.
targetFilensILocalFileIndicates the location at which the downloaded file will be (or is, if the download is complete) stored. Read only.

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:59 次

字数:6837

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文