Have YOU ever tried downloading the same file 102+ times in your favorite browser? Do you know what happens on the 102nd time? 🙃
I do. The answer is ... it depends 😋 It varies between browsers and it’s a bit of a surprise.
Before I show you the screenshots, let me first tell you a short story about how I ended up in the “lets-download-this-file-102-times” rabbit hole so bear with me.
I work as a software developer and one day I got a message from a colleague asking something about a new feature. She sent me a link to an issue. There was a screenshot that caught my attention. It looked very much like the one below.
At the time the file’s name was hardcoded to “Report.zip”. So seeing “Report.zip”, “Report (1).zip” or “Report (42).zip” was to be expected. Instead of a counter, I was suprised to see a timestamp. Where did that come from? It was absolutely not in the code. My colleague didn’t manually add it either. Something was not right. And from here on the rabbit hole got deeper and deeper. 🐰
“A browser setting!” - I thought. It was rulled out quite quickly because she didn’t remember changing any settings. We were looking in Edge because that’s the browser she uses. Besides, such a setting does not exist, I later found out.
“Well, then maybe the browser added it automatically. But at what point?” I started searching on Google, going through different web pages, StackOverflow posts and forums. The more I searched, the more curious I became to figure this out. Then finally - FINALLY - a reply to a Reddit post gave me a pretty strong hint.
But was that still the case? There was only one way to find out. 🚀
Fired up Edge and started downloading.
1, 2, 3, ... 10, ... 42, ... 99 times.
Then something magical 🪄 happened the 102nd time! Instead of bumping a number, Edge added a timestamp 😯 Bingo! 🎉 The mystery was solved. That explained it.
So to make this more scientific, and for the purpose of this post, I decided to repeat the exercise in other browsers. Here are some screenshots.
Edge
Chrome
Firefox
Firefox just continues with bumping the counter. No timestamp here. Also note that there’s no space between the file’s name and the counter in parenthesis, as is the case in Edge/Chrome.
What a TIL!
Thanks for reading thus far. Hope you learned something new. See you in another post 😊
P.S. If you want to try it yourself, I’ve prepared a zip with an empty text file. Go ahead and download it. 102 times, of course.
Or you can quickly put together a simple demo by linking to a local file.
<a href="./fancy.zip" download>Download</a>
Top comments (3)
The timestamp was added the 101st time. Why do keep referring to the 102nd time? 🤔
first time is "filename", second time is "filename(1)"
So essentially it becomes 0 indexed, similar to an array, so the 101st item is "filename(100)" and the 102nd item would be "filename(101)" if the numbering continued.
OP is correct!
Oh. Thanks for pointing that out