content icon indicating copy to clipboard operation
content copied to clipboard

Issue with "Common MIME types": on windows, ZIP files have application/x-zip-compressed for the type

Open Jonesie opened this issue 2 years ago • 11 comments

MDN URL: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types

What information was incorrect, unhelpful, or incomplete?

It seems like on windows, ZIP files have application/x-zip-compressed for the type. At least in Edge and Chrome.

Specific section or headline?

What did you expect to see?

Did you test this? If so, how?

MDN Content page report details
  • Folder: en-us/web/http/basics_of_http/mime_types/common_types
  • MDN URL: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
  • GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/http/basics_of_http/mime_types/common_types/index.md
  • Last commit: https://github.com/mdn/content/commit/9071d9650fae08b4fccae27d8d27bf820ee13a9d
  • Document last modified: 2022-01-24T11:34:39.000Z

Jonesie avatar Mar 02 '22 10:03 Jonesie

It seems like on windows, ZIP files have application/x-zip-compressed for the type. At least in Edge and Chrome.

Can you explain what leads you to that conclusion? Do you have a demo or test case that can be used to confirm it?

sideshowbarker avatar Mar 02 '22 23:03 sideshowbarker

@Jonesie

It seems like on windows, ZIP files have application/x-zip-compressed for the type. At least in Edge and Chrome.

Can you explain what leads you to that conclusion? Do you have a demo or test case that can be used to confirm it?

sideshowbarker avatar Mar 08 '22 03:03 sideshowbarker

Closing for lack of response

sideshowbarker avatar Mar 11 '22 02:03 sideshowbarker

I'm seeing this as well. I zip with 7zip as a ".zip" file, upload to site using standard <input> results in type = 'x-zip-compressed'. I thought this was deprecated?

matt-bn avatar Mar 24 '22 18:03 matt-bn

Still here, when you upload zip file (req.file) from Windows to Node application (ExpressJS). On Mac/Linux req.file.mimetype === 'application/zip'. Windows file is uploaded as 'application/x-zip-compressed'.

JonasJonny avatar Mar 31 '23 19:03 JonasJonny

Without someone providing a reproducible demo case, it seems unlikely that anybody will step in to try to resolve this.

sideshowbarker avatar Mar 31 '23 21:03 sideshowbarker

@sideshowbarker: I think it's "Windows feature" and "no one" can do anything about it anyway.

JonasJonny avatar Apr 01 '23 06:04 JonasJonny

@sideshowbarker: I think it's "Windows feature" and "no one" can do anything about it anyway.

I see. Still, I guess we could add a note to the article about it, as a heads-up at least

sideshowbarker avatar Apr 01 '23 07:04 sideshowbarker

Same here it suddenly started showing application/x-zip-compressed

lianglee avatar Sep 07 '23 17:09 lianglee

Still here, when you upload zip file (req.file) from Windows to Node application (ExpressJS). On Mac/Linux req.file.mimetype === 'application/zip'. Windows file is uploaded as 'application/x-zip-compressed'.

I end up with

const mimeTypeMap = {
  'application/zip': true,
  'application/zip-compressed': true,
  'application/x-zip-compressed': true,
  'multipart/x-zip': true,
  //  'application/octet-stream': true, /* It depends on your use case. */
};

JonasJonny avatar Sep 08 '23 07:09 JonasJonny

I can verify that this is still the case, at least on Windows 10 and Server 2022 – the mimetype seen by a browser for a .zip file is application/zip-compressed. A quick HTML/JS demo at https://jsfiddle.net/qacgoxrw/ and dragging and dropping a file in Firefox, Edge and Chrome yields: mimetype result

Windows is clearly not following the IANA standard of application/zip.

davidjb avatar Feb 13 '24 03:02 davidjb