Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
287 views
in Technique[技术] by (71.8m points)

Amazon S3 PDF files have wrong content type after Winscp upload

Yesterday I transferred ~1500 files to our Amazon S3 bucket using Winscp. I have a problem when downloading PDF files, since they are returned without extension. The cause seems to be the wrong content type being present on the file in the S3 bucket. When I update the content type manually, the file is downloaded correctly. Since I have so many files manually changing the meta data is not an option.

The interesting part is that Excel files do have the correct content type. When looking into this difference, it seems like the machine I upload from does understand the Excel file format, since the file in Winscp is shown with an Excel icon. The PDF files have just a plain white icon.

Does anyone know how to solve the content type problem? Does it depend on the host computer understanding the file type so it can set the correct content type automatically?

question from:https://stackoverflow.com/questions/65950173/amazon-s3-pdf-files-have-wrong-content-type-after-winscp-upload

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

After installing a PDF reader client, in my case Adobe Acrobat Reader, and uploading the files again, the content type is set correctly.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...