If a test needs to interact with the Download Manager or simply has to handle a download of a given file, the DownloadsAPI can be used.
| ||This class supplies a full set of helper functions to provide access to any area of the download manager.|
| ||-1||Download state for uninitialized download object.|
| ||0||Download is currently transferring data.|
| ||1||Download finished including any processing of the target file.|
| ||2||Transfer failed due to error. (completed)|
| ||3||Download was canceled by the user. (completed)|
| ||4||Transfer was paused by the user.|
| ||5||Download is active but data has not yet been received.|
| ||6||Transfer request was blocked by parental controls proxy. (completed)|
| ||7||Transferred download is being scanned by virus scanners.|
| ||8||A virus was detected in the download. The target will most likely no longer exist. (completed)|
| ||9||Windows specific: Request was blocked by zone policy settings. (completed)|
Until we are able to interact with the system level File Save dialog we can only use the helper application dialog to download a file of an unknown content type. This function will automatically download the given file specified by the URL to the current download folder.
downloadFileOfUnknownType( in MozMillController controller, in string url );
- MozMillController of the browser window to work on.
- URL of the file which has to be downloaded.
- Native path or URL of the file.
When a test needs access to the real file object this function will return the
nsILocalFile object from the given path or URL.
nsILocalFile getLocalFileFromNativePathOrUrl( in string aPathOrUrl );
nsILocalFile instance specifying the file.