.tar.gz double compression

Peter

Member
cPanel Username: peterssi

URL: http://dataapa.net/brumbrumrally/download <-- You find .tar.gz files here

Detailed Description: When trying to open a .tar.gz file that has been downloaded from my website it does not work because the server are compressing the file so that it becomes compressed twice, for reasons I can't understand. If I change the name of the downloaded file to filename.tar.gz.gz it opens correctly.

I don't know why this happens or how to fix it. Something must have changed because it has been working before. If I download the file from the CPanel file manager it works correctly.
 

Peter

Member
It does not work with the tar command on Linux.

Code:
$ tar -zxvf brumbrumrally-0.5.tar.gz 
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors
 

un4saken

Administrator
Peter said:
It does not work with the tar command on Linux.

Code:
$ tar -zxvf brumbrumrally-0.5.tar.gz 
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

It's because it's not a tar archive. It's a gunzip archive.

You need to use gunzip or gzip to extract on linux.
 

Peter

Member
tar can handle gzip compression too. That's what the -z flag is for. The reason I mentioned tar is because File Roller (which is the default archive manager on many linux distributions) uses the tar command, and it gives exactly the error I provided above.

But lets not focus on the tools. Like web browsers, users should be able to use whatever tool he or she wants. The problem here is that I have uploaded a file, and when it's downloaded it's no longer the same file.
 

Peter

Member
I have found a solution. I had to disable gzip compression for .tar.gz files in my .htaccess file.

Code:
<FilesMatch \.tar\.gz$>
    SetEnv no-gzip 1
</FilesMatch>