Safari erroneously adding .dms extension to downloads

Discussion in 'macOS' started by Nugget, Oct 24, 2017.

Tags:
  1. Nugget, Oct 24, 2017
    Last edited: Oct 24, 2017

    Nugget macrumors 65816

    Nugget

    Joined:
    Nov 24, 2002
    Location:
    Houston Texas USA
    #1
    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).
    --- Post Merged, Oct 24, 2017 ---
    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...
     
  2. chown33, Oct 24, 2017
    Last edited: Oct 24, 2017

    chown33 macrumors 604

    Joined:
    Aug 9, 2009
    Location:
    Brobdingnag
    #2
    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?
     
  3. Nugget thread starter macrumors 65816

    Nugget

    Joined:
    Nov 24, 2002
    Location:
    Houston Texas USA
    #3
    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.
     
  4. Nugget thread starter macrumors 65816

    Nugget

    Joined:
    Nov 24, 2002
    Location:
    Houston Texas USA
    #4
    For anyone curious, Apple are aware of the issue. The bug I opened has been tagged as a duplicate.
     

    Attached Files:

  5. bd403 macrumors newbie

    Joined:
    Feb 20, 2010
    Location:
    Memphis
    #5
    --- Post Merged, Jan 7, 2018 ---
    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.
     
  6. OCeti macrumors newbie

    OCeti

    Joined:
    Apr 25, 2018
    Location:
    7th Planet, Star System Sol
    #6
    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
     
  7. thisma macrumors member

    Joined:
    Sep 9, 2008
    #7
    I just got a .dms file when the downloaded file should have had no extension. Has an old bug come back again?
     
  8. Nugget thread starter macrumors 65816

    Nugget

    Joined:
    Nov 24, 2002
    Location:
    Houston Texas USA
    #8
    It's never gone away.
     
  9. Fishrrman macrumors G5

    Fishrrman

    Joined:
    Feb 20, 2009
    #9
    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?
     
  10. Nugget thread starter macrumors 65816

    Nugget

    Joined:
    Nov 24, 2002
    Location:
    Houston Texas USA
    #10
    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.

    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.
     
  11. thisma macrumors member

    Joined:
    Sep 9, 2008
    #11
    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"
     
  12. Fishrrman, May 6, 2018
    Last edited: May 6, 2018

    Fishrrman macrumors G5

    Fishrrman

    Joined:
    Feb 20, 2009
    #12
    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...
     
  13. Nugget thread starter macrumors 65816

    Nugget

    Joined:
    Nov 24, 2002
    Location:
    Houston Texas USA
    #13
    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.
     
  14. Fishrrman macrumors G5

    Fishrrman

    Joined:
    Feb 20, 2009
    #14
    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.
     
  15. Nugget, May 6, 2018
    Last edited: May 6, 2018

    Nugget thread starter macrumors 65816

    Nugget

    Joined:
    Nov 24, 2002
    Location:
    Houston Texas USA
    #15
    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.
     
  16. Fishrrman macrumors G5

    Fishrrman

    Joined:
    Feb 20, 2009
    #16
    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?
     
  17. Nugget, May 7, 2018
    Last edited: May 7, 2018

    Nugget thread starter macrumors 65816

    Nugget

    Joined:
    Nov 24, 2002
    Location:
    Houston Texas USA
    #17
    There you go. You now understand the bug completely. Your post could have ended right here.

    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.
     
  18. Fishrrman macrumors G5

    Fishrrman

    Joined:
    Feb 20, 2009
    #18
    "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?
     
  19. Nugget, May 7, 2018
    Last edited: May 7, 2018

    Nugget thread starter macrumors 65816

    Nugget

    Joined:
    Nov 24, 2002
    Location:
    Houston Texas USA
    #19
    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 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).

    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.
     
  20. Chrystal Ocean macrumors member

    Joined:
    Sep 3, 2007
    Location:
    Vancouver Island, Canada
    #20
    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.
     
  21. Username9 macrumors newbie

    Joined:
    Aug 7, 2018
    #21
    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
     
  22. Techno1952 macrumors newbie

    Techno1952

    Joined:
    Mar 31, 2016
    Location:
    Warwickshire, UK
    #22
    --- Post Merged, Aug 19, 2018 at 3:51 AM ---
    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
     
  23. Username9 macrumors newbie

    Joined:
    Aug 7, 2018
    #23
    Hi. Rename the filename to extenxion .jpeg or jpg because it's an image extension.

     
  24. n6ac macrumors newbie

    Joined:
    Apr 7, 2009
    #24
    Wow, I just discovered this after fruitlessly trying to decompress two silly xxx.dms files for CKermit !!!
    2 years gone by and not fixed ...
     

Share This Page