Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Nugget

Contributor
Original poster
Nov 24, 2002
2,121
1,356
Tejas Hill Country
I'm serving some files from an Apache web server and Safari is exhibiting some bizarre behavior. When I download the files (which have no extension of their own, just a base filename), Safari is adding a .dms extension to the file when it saves them.

Neither Firefox or Chrome exhibit the same behavior.

Googling turns up some ancient hits to people having the same problem, one right here on MacRumors back in 2003.

Does anyone have any idea what's going on? Clearly this is some bizarre edge case, but Safari is absolutely doing the wrong thing here. I don't have any Safari extensions installed and I'm seeing the problem on multiple computers (it was first reported to me by a co-worker).
[doublepost=1508894473][/doublepost]Edit to add... I can repro the same behavior with an nginx server as well.

You should be able to reproduce the problem by downloading this file with Safari:

https://macnugget.org/crud/thisfilehasnoextension

Try it in Safari and then some other browser...
 
Last edited:

chown33

Moderator
Staff member
Aug 9, 2009
10,706
8,346
A sea of green
I'd try the 'curl' command in Terminal.app, along with the -I option, and see what the Content-Type header says.
Code:
 curl -I https://macnugget.org/crud/thisfilehasnoextension

Example command and output:
Code:
curl -I http://www.example.com
HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: max-age=604800
Content-Type: text/html
Date: Wed, 25 Oct 2017 05:25:32 GMT
Etag: "359832468"
Expires: Wed, 01 Nov 2017 05:25:32 GMT
Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT
Server: ECS (oxr/839F)
X-Cache: HIT
Content-Length: 1270
You may need to tell curl to use the Safari user-agent string (-A option).

Another thing I'd try is a file on the server with an extension, to see if the Content-Type header is being correctly provided by the server for what should be a well-defined case.

The 'curl' command can also write the received headers to a separate file on the requesting host (-D option). See curl's man page for more info.

Is the nginx server using the same config as Apache? Or a config derived from the Apache config files? In other words, supposing the Apache server is misconfigured, and the nginx server is using a config derived from those files, would nginx produce the same or similar HTTP replies?
 
Last edited:

Nugget

Contributor
Original poster
Nov 24, 2002
2,121
1,356
Tejas Hill Country
The content type is (correctly) “application/octet-stream”

Feel free to test yourself if you’re curious. The url I included in the op is live and working to demonstrate the bug.
 

Nugget

Contributor
Original poster
Nov 24, 2002
2,121
1,356
Tejas Hill Country
For anyone curious, Apple are aware of the issue. The bug I opened has been tagged as a duplicate.
 

Attachments

  • Screen Shot 2017-10-28 at 2.07.46 PM.png
    Screen Shot 2017-10-28 at 2.07.46 PM.png
    60.5 KB · Views: 2,347

bd403

macrumors newbie
Feb 20, 2010
2
0
Memphis
I'm serving some files from an Apache web server and Safari is exhibiting some bizarre behavior. When I download the files (which have no extension of their own, just a base filename), Safari is adding a .dms extension to the file when it saves them.

Neither Firefox or Chrome exhibit the same behavior.

Googling turns up some ancient hits to people having the same problem, one right here on MacRumors back in 2003.

Does anyone have any idea what's going on? Clearly this is some bizarre edge case, but Safari is absolutely doing the wrong thing here. I don't have any Safari extensions installed and I'm seeing the problem on multiple computers (it was first reported to me by a co-worker).
[doublepost=1508894473][/doublepost]Edit to add... I can repro the same behavior with an nginx server as well.

You should be able to reproduce the problem by downloading this file with Safari:

https://macnugget.org/crud/thisfilehasnoextension

Try it in Safari and then some other browser...
[doublepost=1515350353][/doublepost]I am having the same problem with emailing Excel files from my Mac Pro. It started last week of December 2017 and only affects Excel files. All other files email ok. It is not just Safari, I have the same problem using Firefox. I use gmail, but problem exists with Apple Mail, also.
 

OCeti

macrumors newbie
Apr 25, 2018
1
1
7th Planet, Star System Sol
I'm serving some files from an Apache web server and Safari is exhibiting some bizarre behavior. When I download the files (which have no extension of their own, just a base filename), Safari is adding a .dms extension to the file when it saves them.

Neither Firefox or Chrome exhibit the same behavior.

Googling turns up some ancient hits to people having the same problem, one right here on MacRumors back in 2003.

Does anyone have any idea what's going on? Clearly this is some bizarre edge case, but Safari is absolutely doing the wrong thing here. I don't have any Safari extensions installed and I'm seeing the problem on multiple computers (it was first reported to me by a co-worker).
[doublepost=1508894473][/doublepost]Edit to add... I can repro the same behavior with an nginx server as well.

You should be able to reproduce the problem by downloading this file with Safari:

https://macnugget.org/crud/thisfilehasnoextension

Try it in Safari and then some other browser...

Hi folks. I just encountered this error downloading a jquery dmg installer. It landed in my Downloads folder as dms. I tested with the link above to reproduce the problem and it also came down as a dms. I've never seen this problem before. Glad to find this thread here to confirm the issue. However, simply renaming the jquery download file did not resolve the problem. It is not recognized as a dmg file, so the problem could be more than a lack of extension in some cases. -Cheers
 
  • Like
Reactions: silvertech

thisma

macrumors member
Sep 9, 2008
39
5
Hi folks. I just encountered this error downloading a jquery dmg installer. It landed in my Downloads folder as dms. I tested with the link above to reproduce the problem and it also came down as a dms. I've never seen this problem before. Glad to find this thread here to confirm the issue. However, simply renaming the jquery download file did not resolve the problem. It is not recognized as a dmg file, so the problem could be more than a lack of extension in some cases. -Cheers

I just got a .dms file when the downloaded file should have had no extension. Has an old bug come back again?
 

Fishrrman

macrumors Penryn
Feb 20, 2009
28,241
12,388
I don't know if this helps, but when I look at the "dms" extension using the RCDefault App preference pane, it lists "dms" as an "Amiga DMS Disk Archive".

Certainly old and obsolete.

What KIND of files are these "supposed to be" (once downloaded)?

If you rename the extension, can the file be made usable?

Example:
I downloaded the file "thisfilehasnoextension" via the link above.
It "came down" as "an archive" -- as mentioned earlier in this post.
I changed the extension from "dms" to "txt".
I could then open the file using Text Edit (although it appeared to be garbage characters).

Again -- what KIND of files are these supposed to be?

How about providing us with a few more "downloadable examples" -- AND telling us what the files are supposed to represent?
 

Nugget

Contributor
Original poster
Nov 24, 2002
2,121
1,356
Tejas Hill Country
The file in my original post is a macOS binary. If you set it executable it will run. The only change is the added extension, the file is otherwise unchanged.

Code:
$ md5 thisfilehasnoextension
MD5 (thisfilehasnoextension) = de625e71d2e109fc68cd5e5576e9f505
$ file thisfilehasnoextension
thisfilehasnoextension: Mach-O 64-bit executable x86_64
$ ./thisfilehasnoextension
Cows say 'moo'

As mentioned above, the mime content-type is "application/octet-stream" for that file.

How about providing us with a few more "downloadable examples" -- AND telling us what the files are supposed to represent?

I'm not sure who the "us" is that you believe you represent here, but how about dialing back the indignation a bit. I just posted this to be helpful because others are surely having the same problem. Turns out, the post was helpful to many people.
 
  • Like
Reactions: thisma

thisma

macrumors member
Sep 9, 2008
39
5

it lists "dms" as an "Amiga DMS Disk Archive".

What KIND of files are these "supposed to be" (once downloaded)?

If you rename the extension, can the file be made usable?

How about providing us with a few more "downloadable examples"

Ha ha, wow, yeah, it's not an Amiga DMS Disk Archive; I'm quite certain.

Mine was a text file containing JSON formatted data. The data was all there, and correct; so renaming it probably would have worked, except I suspect there simply should be no extension in my case. I just figured out what program was supposed to open it, removed the extension, and opened the file without an extension, which worked.

I have managed to reproduce the effect by creating an empty file with no extension, uploading that file to google drive, and then downloading that file from google drive. Safari adds the extension ".dms"
 
  • Like
Reactions: Nugget

Fishrrman

macrumors Penryn
Feb 20, 2009
28,241
12,388
I asked "what kind of file is it?" because even if Safari is assigning the WRONG extension to it (upon downloading), one can "correct the extension" and then the file will be recognized (by the OS, finder, etc.) properly so it can be opened.

I see this routinely when saving posts from the usenet newsgroups (using Thunderbird). The saved file will download and have ".emi" (or something like that) as the extension, and then the file can't be [easily] opened. Changing the extension to ".txt" fixes it instantly.

So... if you want to fix the downloaded files... you first need to know what kind of file it is (such as text, Word doc, Excel doc, Pages, etc.).
With that info, the "repair" becomes easier by assigning the corresponding extension...
 
Last edited:

Nugget

Contributor
Original poster
Nov 24, 2002
2,121
1,356
Tejas Hill Country
I’m sure everyone is already aware that the .dms extension can be removed to correct the problem. It is, after all, just a file name. The bug is that safari is adding an extension when there should not be one. The correct extension in all these cases is no extension. Safari should not be doing anything here.
 

Fishrrman

macrumors Penryn
Feb 20, 2009
28,241
12,388
OP wrote:
"The bug is that safari is adding an extension when there should not be one. The correct extension in all these cases is no extension. Safari should not be doing anything here."

I could be wrong, but I believe in OS X -EVERY- file has "an extension".
The user may not -see them-, but they still exist even though they are invisible (in the finder).

Even applications have extensions (".app") that are not normally seen by the user.

This harkens back to the "type" and "creator" codes from the old, classic Mac OS.

I'm going to -guess- that the Apache web server mentioned above is not "handing off" such info when Safari downloads the files in question. In that case, Safari has to "guess" as to what the file extension might be.

I know of at least one website from which an mp3 file will be downloaded as "filename.mp3.html" -- essentially incomprehensible to the finder.
Edit the file to remove the ".html" at the end, and it magically becomes an mp3 file (as it is supposed to be).

I welcome correction from others in the know.
 

Nugget

Contributor
Original poster
Nov 24, 2002
2,121
1,356
Tejas Hill Country
I could be wrong, but I believe in OS X -EVERY- file has "an extension".

You are wrong. I suppose the most relevant way to discover this for yourself would be to download the file mentioned in the original post using Chrome or Firefox or curl or wget. Then you can observe for yourself the extensionless file on your system.
 
Last edited:
  • Like
Reactions: ASentientBot

Fishrrman

macrumors Penryn
Feb 20, 2009
28,241
12,388
Again, one can remove an extension (or create a file without one), but without the proper extension, the Mac won't know what to do with it.

I -did- download the file using another browser. It comes down without a visible file extension and appears to be a generic "document" file (no icon).
Double-clicking the file, the finder informs me it's an application and would I like to open it?
I do so. It opens up as a text file in Text Edit. Quit Text Edit, and the file closes, too.

So... it looks to be a text file of some kind, or something that was created and saved "as text".
Or perhaps something else that is getting "mishandled" between the Apache server and the finder.

If I add ".txt" to the file, it opens in Text Edit as before (but with no alert that it's an application).
But the resulting contents looks EXACTLY THE SAME.

If I download the file using Safari, it downloads as "thisfilehasnoextension.dms".
Double click it and the finder tries to "extract" it, but cannot.
BUT... if I -change- ".dms" to ".txt", its icon changes to that of a text document, and double-clicking it opens a file that looks THE SAME as the ones above.

If you don't believe me, repeat these things yourself.

I asked previously and you refused to answer.
What is this file supposed to be?
 

Nugget

Contributor
Original poster
Nov 24, 2002
2,121
1,356
Tejas Hill Country
I -did- download the file using another browser. It comes down without a visible file extension . . . If I download the file using Safari, it downloads as "thisfilehasnoextension.dms".

There you go. You now understand the bug completely. Your post could have ended right here.

I asked previously and you refused to answer. What is this file supposed to be?

Just stop. You're out of your depth here and not contributing anything to the thread with your misguided speculation. Most of what you just posted is incorrect and all of it is irrelevant to the bug being discussed -- Safari adding a ".dms" extension to a file which does not have one.

For the record, please revisit post #10 in the thread where I did answer your question about what the file is, not that it matters in the slightest to the issue. Especially considering that thisma in post 11 observed the bug on an empty, 0 byte file as well. From that we can conclude that the file's contents are not a factor in Safari's misbehavior.
 
Last edited:

Fishrrman

macrumors Penryn
Feb 20, 2009
28,241
12,388
"Just stop. You're out of your depth here and not contributing anything to the thread with your misguided speculation. Most of what you just posted is incorrect and all of it is irrelevant to the bug being discussed"

Safari has bugs?
Is that new?
It's had bugs since it was released.

The file is an app?
A Mac app?
An Applescript?
Or something else?

When I encounter a problem, if I have the solution, I post it.
Or is this entire thread just an attempt to prove a point?
 

Nugget

Contributor
Original poster
Nov 24, 2002
2,121
1,356
Tejas Hill Country
Safari has bugs?Is that new? It's had bugs since it was released.

Yes, and one of those bugs is that it erroneously adds a ".dms" extension when downloading extensionless files. This thread is discussing that bug.


The file is an app? A Mac app? An Applescript? Or something else?

The answer to this is still in post 10 of this thread and will continue to be in post 10 of this thread no matter how many more times you ask. The answer is also still not a factor with the bug. You get that, right? Safari will add the extension even to a 0 byte file that isn't anything at all. The type of file isn't a factor here. The only attribute that seems to matter is that it have no file extension (and possibly be an ambiguous Content-Type).

When I encounter a problem, if I have the solution, I post it.

If that's what you were doing here it would be great. Instead you've posted all sorts of incorrect nonsense like asserting that all files in macOS have to have extensions but that they're sometimes just invisible. Similarly, describing in detail what happens when you try to read a binary executable in TextEdit does not qualify as a "solution" either.

Also as covered in the thread, this bug has been submitted to Apple and hopefully they'll find time to fix it some day. Mostly people just come to this thread because they independently encounter the weird problem and this thread is near the top for Google searches about ".dms" files. It's nice to find the thread and learn that you're not crazy or alone if you're impacted by the weird issue.
 
Last edited:

Chrystal Ocean

macrumors member
Sep 3, 2007
96
80
Vancouver Island, Canada
Just encountered the same thing. The file I wanted to download was supposed to have the .epub extension. Instead, it downloaded as .dms. I changed the extension of the downloaded file to .epub, then added that file to my library management software. All is good. Nothing wrong the file, which was a relief.
 

Username9

macrumors newbie
Aug 7, 2018
2
0
Solution
1- Made a copy of the file
2- Rename the copy whatever name you like.
3- Change de file extension to .jpeg
You all set. Try to open
 

Techno1952

macrumors newbie
Mar 31, 2016
4
1
Warwickshire, UK
Solution
1- Made a copy of the file
2- Rename the copy whatever name you like.
3- Change de file extension to .jpeg
You all set. Try to open
[doublepost=1534675898][/doublepost]Tried this as Safari is renaming gpx files as dms and then i can't open it. Renamed to filename.gpx but when i tried to open the file the dms extension had been added after gpx i.e Filename.gpx.dms
 

Username9

macrumors newbie
Aug 7, 2018
2
0
Hi. Rename the filename to extenxion .jpeg or jpg because it's an image extension.

[doublepost=1534675898][/doublepost]Tried this as Safari is renaming gpx files as dms and then i can't open it. Renamed to filename.gpx but when i tried to open the file the dms extension had been added after gpx i.e Filename.gpx.dms
 

n6ac

macrumors newbie
Apr 7, 2009
7
0
I'm serving some files from an Apache web server and Safari is exhibiting some bizarre behavior. When I download the files (which have no extension of their own, just a base filename), Safari is adding a .dms extension to the file when it saves them. Neither Firefox or Chrome exhibit the same behavior.
...
Wow, I just discovered this after fruitlessly trying to decompress two silly xxx.dms files for CKermit !!!
2 years gone by and not fixed ...
 

kenjamin

macrumors newbie
Sep 13, 2018
1
1
For anyone curious, Apple are aware of the issue. The bug I opened has been tagged as a duplicate.

Sorry if this is a dumb question, but where can I find this bug tracker? Doesn't seem as straight-forward as a simple google.
 
  • Like
Reactions: kironin
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.