DownloadTarget object represents the target of a download, for example a file in the global downloads directory, or a file in the system temporary directory.
||Boolean||Indicates whether or not the target file exists. This is a dynamic property, which is updated when the download is completed or when the
||The path of the target file.|
||The path of the "
The size of the target file, in bytes, or zero if the download has not yet been completed.
It is possible for this property to have a non-zero value even if the target file no longer exists, if the value is available in download metadata. If that metadata is no longer available and the file has been deleted, then this value is zero.
For single-file downloads, this property's value will always match the actual size of the file on disk, while the
For downloads of multiple files, such as downloading a web page and its required media to disk, the meaning of this property is undefined. It currently indicates the size of the main file (such as the HTML document) rather than the sum of all of the files' sizes, but you must not rely upon this behavior, as it is subject to change.
This is a dynamic property, which is updated when the download finishes or whenever the
Updates the state of a finished, failed, or canceled download based on the current state as indicated by the file system. If the download is in progress or has been finalized, this method does nothing and returns a resolved Promise.
Calling this method lets the
Download object's properties be updated if the user moves or deletes the target file or its associated ".part" file, which contains a partially-downloaded file's contents.
Promise resolves to
undefined when the state of the download has been updated.
Promise can be rejected with