url - Opening .pdf files in browser from Amazon S3 with AWS Key and Signature attributes? -
when try clicking pdf link on website in chrome , ff not anything. can right-click , save cannot open within browser. both browsers have adobe reader enabled , works when remove aws key , signature.
https://s3.amazonaws.com/bucket/sample.pdf?awsaccesskeyid=&expires=&signature= // not open https://s3.amazonaws.com/bucket/mypdf.pdf // opens fine
it works fine in both ie , opera. way bypass this?
the reason of problem obvious, difficult resolve. when open nonkey link
https://s3.amazonaws.com/bucket/mypdf.pdf
browser gets .pdf extension @ end of link , tries download it. when have additional request params link not ends .pdf , may cause problem.
it looks uploaded pdf file got no metadata content-type. if don't have figure out content types automatically checkbox checked during upload, try set content-type manually adding metadata
content-type: application/pdf
other idea make browser think link ending .pdf, try download link:
https://s3.amazonaws.com/bucket/sample.pdf?awsaccesskeyid=a&expires=b&signature=c&file=sample.pdf
Comments
Post a Comment