Duplicate downloads replacing files: I'd call this a Safari bug

… Not sure when the feature started in Safari wherein duplicate downloads, within close proximity in time, would be replaced by the latest download…
But I have noticed a bit of a flaw in that feature.
Example: When downloading zipped music files at Bandcamp a zip archive of the same name can replace a previous version of the same name: even though its contents are different.
For my example the following can occur: A zip file with my preferred aiff files was deleted when accidentally downloading the same album in a different file format not preferred (mp3)

This seems like a bug to me

1 Like

I haven’t noticed such behavior yet but the intent is understandable, avoiding confusion and wasting disk space when people make the common error of redownloading the same file.

If the two downloads are from two distinct URLs, I’d definitely call it a Safari bug. If the URL is identical both times, I don’t know what else Apple could do except to drop the feature.

I suggest reporting the bug to Apple with as much detail as you can. In the report, don’t assume such file overwriting is an intended feature, just contrast what you expected with what actually happened. Be specific about the site, browsers are known to include site-specific tweaks to their behavior and I think Bandcamp is prominent enough to be considered.

I also suggest reporting this to Bandcamp. This kind of problem is entirely avoidable by them making downloads with distinct contents have distinct filenames.

2 Likes

Thanks for those advisory notes

New Update: interestingly I went back to duplicate the scenario and today I see that
similarly named zips are being appended with a -2 in order to differentiate the download
This was not occurring previously. So it is a bit unclear when the space saving feature is kicking in … or not, as the case may be
So as of now my bug alert is somewhat unverifiable

I have noticed this feature of Safari since I started using MacOS 12 (Monterey). But I’ve never had it replace a file that was different (not that I’ve tried), only replace a file that I accidentally downloaded a second time. It struck me as useful, but I assumed it was only replacing the file because the source URL and sizes are the same. If it doesn’t do those checks, I’d agree it’s a bug (or buggy implementation).

Needs more observational time to isolate behavior, perhaps. May be a rare bug due to the myriad cloud-integration bits. There is a lot of caching and creative file manipulation going on these days behind the scenes.

I have not used Safari extensively in recent years, but at one time it would download files with date/time stamps based on the SOURCE file on the server. This would cause confusion with those expecting it to appear at the top/bottom if sorting by date. This could usually be worked around by checking the filename in download history, and then sorting alphabetically (or Finder search).

re: Needs more observational time
Indeed, after trying to replicate the issue, Safari is appending and similar and duplicate* file downloads with a modified file name…
Perhaps I was hasty in posting the alert

*Interestingly, now even duplicates are not triggering the space saving feature of trashing the duplicate while maintaining its previously downloaded item
I have occasionally seen the duplicate download replace the previous download, as well as seen
the duplicate not appear in the folder with only the orginal download retained in the folder

This has definitely been a problem for a long time. I see it frequently. For instance, every year about this time I go to download all my past year’s bank statements to go through for my tax preparation. At least one of my banks names the downloaded file “stmt.txt” with no indication of which month it is. If I click on several months to download each statement, I will only end up with the most recent one as the others get downloaded and then overwritten. So instead of clicking 12 times (once for each month) I have to click, go to the Downloads folder, rename the file with the appropriate month number, go back to Safari, and click on the next month. It’s annoying.

I’ve had to do this for years, though one of my banks this year did finally change their filenames this year so now it only happens with one bank.

That’s just one example: I’ve had the problem with downloads on other sites, too. (Like a clipart/stock photo site where I painstakingly went through to find and download thumbnails of a dozen possible graphics I might want to use, and when I went to the Finder there was only a single file saved, called preview.jpg – the site named all the thumbnails the same. :man_facepalming:t3:)

Sort of interesting.
For me, Safari typically rather simply always added some re-identifying file name change
… basically adding a -2, -3 etc.
I could add that Safari is not alone in curious downloading anomalies
I subscribe to a podcast site for which Safari will download, correctly aac-enchanced aac.m4a files.
Firefox on the other hand changes the file type to aac.mp4 with Quicktime as the default app.
No clue why Firefox is actually changing the file type. And unitl recently it was no simple name change either since one could not simply append the correct file type to the download, that part has been fixed, but Firefox still changes the file from m4a to mp4

That’s the strange thing – I have seen that in other situations. So sometimes Safari does it, but not others. I have never been able to figure out the reasoning. It’s certainly not file size or contents, because two different files with same name get overwritten. But other times it will append a “1” number at the end to show it’s a duplicate.

Maybe it’s something with how the site handles the download request?

I recommend you configure Safari to ask you for the download location for every file. You can then use the “save as” dialog to name each file as it is downloaded, avoiding the problem:

An easy way around this is to hold down the option ⌥ key when clicking the download link. [See correction below.] This way Safari will ask you where to save the file, allowing you to name it before downloading. So you can quickly go through the twelve links and download them all with different names. But the default behaviour elsewhere will still be to download automatically without having to deal with the save dialogue.

2 Likes

I hold down Option all the time to download items. I’ve never been asked to name the file. I wonder if that’s controlled by the Safari setting David mentioned earlier?

But for me, this is only really a hassle once a year for 12 files, and I normally prefer everything just going to my Downloads folder automatically for later sorting, so it’s not a big deal.

It would be nice if Safari wouldn’t replace downloads with the same name, though, and I find it odd that it works differently with some files over others.

Apologies, I was on my phone and misremembered this. I’m not sure how, but in my mind there was a key I held down when I wanted to choose where to download a file to. But I can’t replicate that no matter what key combination I press!

However, there is a way to choose where to download a file (and name it) as a one-off with the mouse. Secondary click1 on a link to bring up the contextual menu, and choose Download Linked File As…. This might be quicker for the one time you’re downloading those 12 files, as you can stay in Safari instead of switching back and forth with the Finder.

1e.g. ctrl-click, two finger tap, right click

Just thought I would mention that portions of this thread have been recently posted elsewhere
https://mjtsai.com/blog/2023/04/18/duplicate-safari-downloads-replacing-files/

so, just thought I would mention here that the post does not really refer to the whole conversation of issues around this found in this thread.
For instance, while Safari’s handling of duplicate downloads can still be a bit haphazard … so far, for some reason, I have not been able to re-replicate the glitch wherein a zip file with aiff contents gets replaced by a zip file containing another file format