Reputation: 873
aws s3 cp s3://bucketname/path/to/file/filename.csv.gz . --content-encoding gzip
I'm just trying to download a compressed csv file from a bucket that we don't control but have permissions to. I ran the above and the file downloads but is not viable. The result is in the picture below.
How can I download a viable file?
Upvotes: 3
Views: 1598
Reputation: 69
You can download the file as it is. It will be download as a csv file but with a compressed content. So, you can rename the file as a gz file and then decompress it. That will solve the problem.
If you are using terminal commands and the downloaded file name is x.csv
mv x.csv x.gz
gzip -d x.gz
Upvotes: 0
Reputation: 35178
The object in question still needs to be decompressed.
Try performing the following command instead aws s3 cp s3://bucketname/path/to/file/filename.csv.gz ---content-encoding gzip | gzip -d
to automatically decompress it on the way out
Upvotes: 1