When I try clicking a pdf link on my website in Chrome and FF it does not do anything. I can right-click and save as but I cannot open it up within the browser. Both browsers have adobe reader enabled and works when I remove the AWS Key and signature.
https://s3.amazonaws.com/bucket/sample.pdf?AWSAccessKeyId=&Expires=&Signature= // Does not open
https://s3.amazonaws.com/bucket/mypdf.pdf // Opens fine
It works fine in both IE and Opera. Any way to bypass this?
The reason of your problem is really obvious, but could be difficult to resolve. When you open nonKey link
https://s3.amazonaws.com/bucket/mypdf.pdf
browser gets .pdf extension at the end of the link and tries to download it. But when you have additional request params your link is not ends with .pdf and that may cause the problem.
It looks like your uploaded pdf file got no metadata for content-type. If you don't have Figure out content types automatically checkbox checked during upload, try to set content-type manually by adding metadata
content-type: application/pdf
Other idea is to make browser think that the link is ending with .pdf, so try to download with this link:
https://s3.amazonaws.com/bucket/sample.pdf?AWSAccessKeyId=a&Expires=b&Signature=c&file=sample.pdf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With