Closed Bug 227282 Opened 19 years ago Closed 19 years ago

Download Manager silently overwrites files (doesn't prompt or number files) when left clicking link

Categories

(Toolkit :: Downloads API, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla1.6

People

(Reporter: mysterioususer, Assigned: bugs)

References

Details

(Keywords: dataloss, regression)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031201 Firebird/0.7+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031201 Firebird/0.7+

When setting Mozilla Firebird to automatically save files in a certain folder
(eg Desktop or Downloads), it should not automatically overwrite files if a file
with the same file name already exists.  I tested this by downloading MozillaFB
nightlies, which never have different file names (MozillaFirebird-win32.zip).

Reproducible: Always

Steps to Reproduce:
1. Make sure Download manager is set to "save all files in this folder"
2. Download a file that has the same name as a file that already exists in said
folder (try http://ftp.mozilla.org/pub/mozilla.org/firebird/nightly/latest-trunk/)
3. 

Actual Results:  
Firebird doesn't prompt whether or not the file should be overwritten.

Expected Results:  
A small dialog box should come up to say something to the effect of "A file by
that name already exists.  Overwrite?"

It appears that if you ask firebird to prompt you where to download each
individual file, then it does indeed ask whether or not it should overwrite
(this may be more of a function of Windows than of Firebird though)
I can confirm this on Windows and Linux 2003-12-02. Am upping to critical since
unintended data loss can occur.
Severity: minor → critical
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
*** Bug 226177 has been marked as a duplicate of this bug. ***
Keywords: dataloss
1) Firebird overwrites instead of appending -1, -2.
This is a behavior change.  We need to determine if this happened with the new
Download Manager.
2) Firebird doesn't ask if it should overwrite. 
That should be a seperate bug.
It should be doing the -1, -2 thing. ->me, 0.8
Assignee: blake → bugs
Priority: -- → P2
Target Milestone: --- → Firebird0.8
Prompt vs append numbers -> bug 227343
Summary: Download Manager should prompt if overwriting files → Download Manager silently overwrites files (doesn't prompt or number files)
OK. I've re-read this, more carefully this time, and it seems there's no bug. I
can't find a case where fb is actually overwriting an existing file without
asking. I tried doing the following things:

Setup:
First, I created an empty file with the name "MozillaFirebird-win32.zip" on my
desktop.


Testing Download Manager "Retry":
1) Then, I began a download of MozillaFirebird-win32.zip from the nightly
directory on the ftp site. 
2) Before it completed, I canceled the download. 
3) I double clicked the canceled item to retry the download. 
4) The file was downloaded to MozillaFirebird-win32-1.zip on my desktop. The
original empty file was untouched. 

Testing Link Click Downloading
1) I clicked the MozillaFirebird-win32.zip link in the nightly dir. 
2) I let the download complete
3) The file eventually appeared as "MozillaFirebird-win32-2.zip" on my desktop.
The original empty file was untouched. 

Testing "Save Link to Disk" context menu item
1) I right clicked on the link to MozillaFirebird-win32.zip in the nightly dir,
and chose "Save Link to Disk"
2) I let the download complete
3) The file showed up on my desktop as MozillaFirebird-win32-3.zip" on my
desktop. The original empty file was untouched. 

I see no "bug" here. See the bug Jesse mentions for more on the -1, -2, -3
behavior. 
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → WORKSFORME
Ben-
I can't believe I'm writing this, but which build did you test with?

Albert and Ali-
What steps did you follow that caused it to overwrite?
UA: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031203
Firebird/0.7+

Using the official Win32 2003-12-03 nightly with no profile in %AppData%:

1. Run Firebird (it creates a new profile).
2. Click the link to download Mozilla Firebird 0.7 for Windows from the default
home page.

Actual Results:
It prompts you and asks where to save it.

Expected Results:
Since the prefs dialog says it should auto save to desktop (which is the default
setting), once you press save, it should just save there and not ask you. It's
acting as if its in Ask me where to save mode.

Issue #2:

1. Set pref to ask me where to save.
2. Set back to download automatically to desktop
3. Click link to Mozilla Firebird 0.7 for Windows
4. Choose save

Actual results:
Overwrites the previous download without asking

Expected Results:
Save as foo-1.zip

Based on this, I suggest REOPEN.
Alan, the last win32 installer nightly on the ftp site. 
I don't see it overwrite. Watch closely. It does something else, which is also a
bug: 

I download: 
MozillaFirebird-0.7-win32.zip
I then download the same file, and end up with:

MozillaFirebird-1.7-win32.zip

At first glance the two might look the same, but they're separate files. This
issue deserves a separate bug. ("-1, -2 naming performed incorrectly on files
with |-digit| in their name") 

I'm looking at the first issue that you mention, which is _also_ a separate bug. 
Well, using the steps I noted originally, I thought I was noticing incorrect
behavior by Firebird, but I am no longer able to reproduce it.  Obviously, let's
keep this bug closed :)  Sorry for any trouble.
WFM Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031201
Firebird/0.7+

So how did this bug get 4 votes?
Hi,

I am one of those who viote for this bug, because I could reproduce it. I just
made several tests (clearing all profiles, nightly and installer) and I am able
to reproduce it still.

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031203
Firebird/0.7+ (installer)

Reproducible: Always
1. Create a folder "download" on desktop
2. Setup that all downloaded files shall be saved here
3. Open
http://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/2003-12-04-0.4/ using 
4. Dowload thunderbird-win32.zip with a click on it.
5. Wait until file is downloaded
6. Repeat 4.

FB is not asking to overwrite the file or mentioning that this file exists.
I also tried to download it using "Save Link To Disk". There also no question
dialog came up, but he downloaded the file putting a "-1" at the end. I cannot
reproduce this when clicking on the file directly. Tried it several times eben
with new profile and reinstalling mozilla and always can reproduce it. I think
it still is there...
> MozillaFirebird-1.7-win32.zip

Sorry Ben, this isn't what I'm seeing. I'm getting the overwriting behaviour as
I mentioned before. Could this be an OS specific issue? I'm using Windows XP
Professional with SP1 applied plus all patches.
OK, I just tried it again at a time when I'm more lucid, and I think I'm
starting to notice something new.

The reason I thought it had been fixed before was because I didn't notice I was
saving it in a different manner.  If you just left-click on download links (such
as off the Mozilla FTPs), it silently overwrites them.  This is true regardless
of whether I used the FirebirdSetup.exe or the MozillaFirebird-win32.zip or even
the thunderbird-win32.zip file; in all cases, just simply clicking to download
and then saying "save to disk" results in Firebird overwriting the file.

However, on some other files I was testing, I was saving them in a different manner:
1. Go to suprnova.org, find some .torrent file you want (make it any file, it
doesn't matter really).
2. *Right-click* on the link and select "Save Link As..."
3. When the open/save dialog comes up, just click save to disk and hit OK.
4. Repeat a couple of times for good measure
When you follow those steps, Firebird *does* actually do the -1, -2 thing.  If
you do the same thing on files on the mozilla FTP, it also does the -1, -2
behavior properly.

For what it's worth, I'm still using the 20031201 Win32 build on XPHome SP1. 
Can someone confirm this so I can make sure I'm seeing things right?  I'm
thinking we should reopen the bug.
I'm confirming Albert's findings with 2003-12-04 CVS version. Left click
overwrites, right click --> save as appends number.

--> REOPENED
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Summary: Download Manager silently overwrites files (doesn't prompt or number files) → Download Manager silently overwrites files (doesn't prompt or number files) when left clicking link
WFM when left-clicking links.

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031204
Firebird/0.7+ (aebrahim)
This is what I think would be the best implementation:

Whether you left click or right click, firebird should check if the file already
exists. If yes, it should ask the following:
 ___________________________________________
[                                           ]
[  The file c:\firebird.exe already exists. ]
[  Do you want to                           ]
[   <Overwrite>    <rename>    <Cancel>     ]
[___________________________________________]

The rename botton should suggest firebird(1).exe etc.
This should satisfy all users.
Hussam-
That is bug 227343.  This is about overwriting without asking, when it should be
getting a new name automatically.
Oh Ok, now i understand. Sorry for that, I'll post my suggestion in bug 227343.
Keywords: regression
AHA!

OK, I see the bug now. 

The steps to reproduce are:
1) New profile
2) Create an empty file on the desktop (or default download dir) with the file
name of a file on ftp.m.o, verify that this file is 0 bytes. 
2) Click a download link on ftp.m.o to a file with the same name. 
3) Click "Save to Disk" in the UCT dialog, do NOT click "Do this automatically
for files like this from now on"
4) Look at file size of file on desktop. It's now big, i.e. the file was
overwritten. 

I discovered that when the UCT dialog shows, files are overwritten, because the
code path is different from when the UCT dialog does not show. I've checked in a
fix. 
Status: REOPENED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → FIXED
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.