2

I've had an issue reported by users on the Jenkins system I've installed at my new company. When downloading release files with the extension ".tgz" (tar'd gzip'd files from Linux), these files are having their file extension renamed to ".gz" by MS Internet Explorer and Edge browsers when we download them.

I've reproduced this on IE. If you just left-click on the download link, it automatically and silently renames the file it downloads to ".gz". If you right-click and select "Save target as", the default extension is ".gz". I don't have anything with Edge, but I've no reason to doubt the report.

I did some investigation to see whether I could narrow it down...

This is not an issue I noticed with the Jenkins setup at my previous company. That said though, at my previous company we had a policy of using Chrome or Firefox in preferences to IE, so it's entirely possible that the issue existed there and we just never noticed it. My real job is embedded software, so devops is not something I have deep skills in.

Does anyone have any insights into this, please?

  • Check HTTP headers of the reponse. Content-Disposition: attachment header can be used to suggest a name for downloaded files. Maybe Jenkins suggests wrong extension via header and some browsers accept it, while others extract extension from URL. You can easily capture headers with Fiddler. – gronostaj Nov 14 '18 at 17:17
  • I have used the jsfiddle from your first link, and Edge downloaded it just fine it as .tgz. IE is going very slow, but the temporary name does have .tgz in it. As your second link says, the header files are everything here, so please add all your headers to the post for checkup. The jsfiddle does not have any headers, so the browsers don't muck it up. – harrymc Nov 14 '18 at 17:19
  • @gronostaj Thanks - I'll have a look at that. – Graham Nov 14 '18 at 17:22
  • @harrymc Interestingly, your Lenovo download works fine, but the Moodle download from my post doesn't. As you both say, that does suggest it's a server setup thing. It's still very odd, especially since users of other software (e.g. Moodle) don't seem to have noticed it. – Graham Nov 14 '18 at 18:36
  • @harrymc Ah, I misunderstood what you both meant. You meant it might be an issue with the HTTP headers in the page showing me the links. But entering just the download link into the address bar on a new tab, I get the same behaviour. And I get the same behaviour from the Moodle download. So I suspect it is not related to HTTP headers. – Graham Nov 14 '18 at 18:51
2

Edge is simply looking at the Content-type header to determine what file extension to use, as indicated by the issue you linked.

Moodle:  application/g-zip  
Varnish: application/octet-stream  
Silva:   application/gzip  
Zimbra:  binary/octet-stream  
lpopt:   application/x-gzip  
lapack:  application/x-gzip  
gmsh:    application/x-gzip

So clearly you somehow have a file association for application/x-gzip and application/g-zip.

  • It’s also fascinating how there is only one correct gzip mime type here: application/gzip. application/octet-stream is also valid though just generic binary, all others are not registered with IANA. – Daniel B Nov 14 '18 at 19:22
  • Cool, thanks. I'll dig into the Nginx settings and check how I get that to work then - and how I then get that to sort out the Content-type. Like I said, devops isn't really my thing, so I'm winging it a bit. :) – Graham Nov 14 '18 at 19:46
  • Technically the mime type is correct as is. It is a gzip file, after all. ;) – Daniel B Nov 14 '18 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.