Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS S3: .csv file is downloaded as .csv

I have 2 AWC accounts, each of them has one S3 bucket. I uploaded two same-size .CSV files to each of the S3 bucket.

When I try to Download or Download As, this file is downloaded as .CSV file in first account. BUT(!!) When I try to download this file from second account - it is downloading it as .TXT.

How can this happen? Both files are created in the same way: through Redshift UNLOAD query, that perform copying of selected data from Redshift to S3.

UPDATE: Can it be because in this account for this document , **Server side encryption is equal to AWS-KMS? I noticed that file, that converted from .csv to .txt has "Server side encryption: AWS-KMS", while .csv file that is downloaded as .csv - has "Server side encryption: NONE"

UPDATE: tried in different browsers - same result

enter image description here

like image 596
Bilberryfm Avatar asked Mar 07 '23 20:03

Bilberryfm


1 Answers

Check the headers for each object in the AWS S3 console and compare the Content-Type values. Content-Type provides a hint to web browsers on what data the object contains.

If Content-Type does not exist or does not contain text/csv, add or modify the header in the S3 console or via your favorite S3 application such as CloudBerry.

like image 146
John Hanley Avatar answered Mar 20 '23 01:03

John Hanley