I recently experienced the following issue using the AWS CLI:
- I uploaded a .csv.gz file to S3.
- I generated a presigned link.
- The presigned link served the file with the wrong extension(.csv.csv instead of .csv.gz).
I think this is a bug in S3, where they misidentify the file type when a file has multiple extensions.
Thankfully, this can be easily solved, both for existing files, and for future uploads:
Thankfully, this can be easily solved, both for existing files, and for future uploads:
- For existing files: I clicked on the object in the web interface, and scrolled down to Metadata.
- Sure enough, the "Content-Type" key had the wrong value (it was "text/csv").
- I clicked the "Edit" button, and manually changed it to the correct type, namely "application/x-gzip". They have The existing presigned link also reflected the change.
- For future uploads: setting the content type explicitly ensures I will always get the desired content type, e.g.: --content-type application/x-gzip
No comments:
Post a Comment