Renaming a file I am downloading with Safari removes the file extension, as it is treated like part of the filename

When I download a file in Safari, and I rename it in the "Save As" dialogue box that pops up, the window treats the file extension as part of the filename, meaning that when I rename it I need to either deselect it or add it back in. This problem is rather hard to describe but easy to demonstrate visually.

Before: The extension is selected as part of the filename to be replaced.

After: The extension has been replaced.

If I open it without renaming it, it opens in TextEdit as if it were a .txt file.

I have been able to find some people on various fora who have also had this bug, but none of. those threads actually figure out what is causing it or how to fix it. Though I have done all they asked:


  • Toggling “Show file name extensions” in Finder doesn’t help.
  • Clearing my browser history doesn’t help.
  • Downloading a file in a test user account reproduces the problem, meaning it’s system wide.
  • Downloading a file in Chrome shows that the issue is Safari-specific.


Nothing has helped fix it or diagnose it.


This is Safari 17.0. The only extension it’s running is WebEx—I deleted that, but the issue remained

macOS Sonoma 14.0, but the problem has been ongoing—I’m not sure when it started but it certainly predates Sonoma.


Any advice on this would be appreciated. It’s the sort of small, stupid thing that you deal with every day that isn’t at all fatal to whatever you’re doing but still you to no end. Thanks!

MacBook Air 13″, macOS 14.0

Posted on Nov 11, 2023 3:05 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 11, 2023 6:05 PM

This is not new behaviour in Sonoma; Safari has always pre-selected the entire file name as it exists on the server. For example if you were to download https://www.apple.com/safari/docs/Safari_White_Paper_Nov_2019.pdf and choose Save As... intending to rename it, the entire file name is already selected. Typing whatever you want overwrites it.


In that example, saving it removes the file extension and Get Info reports it will be opened with TextEdit. However, double-clicking that file icon will actually open Preview since the file attributes inform macOS that TextEdit is inappropriate.


In the case of opening a Word document from which you deliberately removed the extension, the Mac will make its "best guess" drawing upon those file attributes, which results in opening TextEdit since .docx is not something macOS incorporates.


If you were to just as deliberately add a .txt file name extension to the PDF above, then macOS will assume you deliberately intended to inform macOS not to investigate the file attributes. It will open TextEdit instead.


All of this is a longwinded way of saying what you describe is normal, and there is nothing to fix as far as Safari is concerned. I appreciate the fact you would prefer Safari to pre-select the file name as it exists on the server while de-selecting its extension, but that's just not the way macOS or its predecessors has ever worked. Filename extensions didn't exist in the original Macintosh Finder, but were added to OS X as sort of an afterthought for PC / Windows interoperability.


If you think it's something Apple should consider in future macOS versions, by all means make that suggestion to them here: Product Feedback - Apple

Similar questions

2 replies
Question marked as Top-ranking reply

Nov 11, 2023 6:05 PM in response to Basil Utter

This is not new behaviour in Sonoma; Safari has always pre-selected the entire file name as it exists on the server. For example if you were to download https://www.apple.com/safari/docs/Safari_White_Paper_Nov_2019.pdf and choose Save As... intending to rename it, the entire file name is already selected. Typing whatever you want overwrites it.


In that example, saving it removes the file extension and Get Info reports it will be opened with TextEdit. However, double-clicking that file icon will actually open Preview since the file attributes inform macOS that TextEdit is inappropriate.


In the case of opening a Word document from which you deliberately removed the extension, the Mac will make its "best guess" drawing upon those file attributes, which results in opening TextEdit since .docx is not something macOS incorporates.


If you were to just as deliberately add a .txt file name extension to the PDF above, then macOS will assume you deliberately intended to inform macOS not to investigate the file attributes. It will open TextEdit instead.


All of this is a longwinded way of saying what you describe is normal, and there is nothing to fix as far as Safari is concerned. I appreciate the fact you would prefer Safari to pre-select the file name as it exists on the server while de-selecting its extension, but that's just not the way macOS or its predecessors has ever worked. Filename extensions didn't exist in the original Macintosh Finder, but were added to OS X as sort of an afterthought for PC / Windows interoperability.


If you think it's something Apple should consider in future macOS versions, by all means make that suggestion to them here: Product Feedback - Apple

Nov 12, 2023 6:28 PM in response to John Galt

Yeah, I can see how it would be something that was always there and I never noticed, or assumed it was just part of it, as you said—and then at a certain point I thought it was too weird a thing to not be some sort of settings thing.


You do say I “deliberately” removed the extension, but to be clear, I’m not doing so deliberately but inadvertently. The only thing that is deliberate is Apple’s decision to not deselect (or simply hide) the extension, as it does in Finder and wherever else. And I am honestly curious as to why. What purpose could it serve to have the default be to remove the extension upon renaming? (And yes I know this is far too many words over such a tiny problem, and yes I need to get over it, it is just a inexplicable UX choice on their part).

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Renaming a file I am downloading with Safari removes the file extension, as it is treated like part of the filename

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.