User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:18.104.22.168) Gecko/2009011912 Firefox/3.0.6 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:22.214.171.124) Gecko/2009011912 Firefox/3.0.6 I'm writing an extension that monitors downloaded files. So I register an nsIDownloadProgressListener in which onDownloadStateChange(aState, aDownload) in case of aDownload.state == 1 should give me the target path via aDownload.targetFile.path. Correct? This indeed works most of the time, except when user downloads the same file more than once. In such a case FF would silently use /tmp/filename-1.ext, /tmp/filename-2.ext etc instead of /tmp/filename.ext, however aDownload.targetFile.path still says /tmp/filename.ext. NB: of course, this concerns only "silent" downloads (i.e., when FF downloads a file for opening it in an application and picks a target path automatically). "Save link as" is fine. Reproducible: Always
Component: Extension Compatibility → Download Manager
Product: Firefox → Toolkit
QA Contact: extension.compatibility → download.manager
Version: 3.0 Branch → unspecified
I can confirm this problem on Windows xp When using "Open with", files are saved to the temp directory. If a file with that name already exists, the download manager correctly increments the filename, but does not put this new filename in the downloads.sqlite database. This is a problem because if you try to open the second file from the download manager, it will open the first instead.
Created attachment 384273 [details] Screenshot of the problem Here I have downloaded "fw4.pdf" using "open with" The second time, the file gets saved in windows as "fw4-1.pdf" (on the right) You can see in the raw data from downloads.sqlite (bottom) that the file name and local location did not get the incremented "fw4-1.pdf" name
Status: UNCONFIRMED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 301328
You need to log in before you can comment on or make changes to this bug.