The Download Manager schema

The Download Manager uses an SQLite table to keep track of downloads in progress as well as queued and past downloads.

The table is kept in a database file named "downloads.sqlite", in a table called "moz_downloads". The current database schema version is 8.

This information is available using nsIDownloadManager methods to retrieve nsIDownload objects for each download entry; however, if you feel like poking directly into the table, you can do so using the Storage API.

The schema table

Field name Type Description
id INTEGER A unique ID for the download. This field is the primary key for the table.
name TEXT The download's file name.
source TEXT The source URI for the download.
target TEXT The destination URI for the download.
tempPath TEXT The path of the temporary file being used for the download.
startTime INTEGER The download's start time.
endTime INTEGER The download's end time.
state INTEGER The download's current state. See the constants list in the nsIDownloadManager documentation.
referrer TEXT The referrer for the download.
entityID TEXT The entity ID from the nsIResumableChannel used to implement the download channel. This information is used to resume the download after it's been paused.
currBytes INTEGER The current number of bytes that have been downloaded. Defaults to 0, may not be null.
maxBytes INTEGER The total number of bytes that need to be downloaded. Defaults to -1, may not be null.
mimeType TEXT The MIME type of the file.
preferredApplication TEXT The preferred application to use to open the file after the download is complete.
preferredAction INTEGER The action constant from nsIMIMEInfo representing the action to take upon completing the download. Default 0 (save to disk); may not be null.
autoResume INTEGER 0 if the file should not automatically resume downloading, 1 if it should. Defaults to 0, and may not be null.

See also

Document Tags and Contributors

Tags: 
Last updated by: Mgjbot,