Closed
Bug 478394
Opened 15 years ago
Closed 15 years ago
targetFile.path is not updated when the target file already exists
Categories
(Toolkit :: Downloads API, defect)
Tracking
()
VERIFIED
DUPLICATE
of bug 301328
People
(Reporter: evgeny, Unassigned)
References
Details
Attachments
(1 file)
40.72 KB,
image/png
|
Details |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.6) Gecko/2009011912 Firefox/3.0.6 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.6) 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
Updated•15 years ago
|
Component: Extension Compatibility → Download Manager
Product: Firefox → Toolkit
QA Contact: extension.compatibility → download.manager
Version: 3.0 Branch → unspecified
Comment 1•15 years ago
|
||
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.
Comment 2•15 years ago
|
||
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
Updated•15 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
Updated•15 years ago
|
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•