detect the gzip format when downloading a file and decompress it