0

We are hosting a number of .tar.gz files on our Apache server. When we download these files, the filename of the downloaded file is the same as on the server... something.tar.gz... but the file is actually an uncompressed tarball (as if just a .tar).

The response headers include

Content-Type: application/x-gzip
Content-Encoding: x-gzip

What Apache configuration can be used to cause these files to be downloaded as gzipped tarballs still named .tar.gz?

2 Answers2

2

I had to add the following directive to get intentionally gzipped files to download without silently decompressing:

AddEncoding x-identity .tar.gz .gz .tgz
Mike Godin
  • 143
  • 7
0

The problematic configuration was having both

AddEncoding x-gzip .gz .tgz

and

AddType application/x-gzip .gz .tgz

Removing the AddEncoding line fixed the problem.