0
我放置存儲桶策略,以便只有從某個網站引用的用戶才能訪問我的Amazon S3存儲中的某個PDF文件。PDF文件不會在存儲桶策略(在其他瀏覽器中加載)後在Chrome中加載
該文件設置爲私人,並且存儲桶策略似乎運行良好,除了Chrome在打開PDF文件時卡在加載頁面上的事實。但是,我可以通過右鍵單擊並保存鏈接來下載PDF。
它也爲IE做這個,但在Safari和Firefox中運行良好。我嘗試清除緩存,但沒有幫助。
下面是我用水桶政策:
{
"Version": "2012-10-17",
"Id": "http referer policy example",
"Statement": [
{
"Sid": "Allow get requests originated from www.example.com and example.com",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::examplebucket/*",
"Condition": {
"StringLike": {
"aws:Referer": [
"http://example.com/*",
"http://www.example.com/*"
]
}
}
}
]
}
感謝
懷疑CORS問題。檢查此線程是否有幫助:http://stackoverflow.com/questions/20253472/cors-problems-with-amazon-s3-on-the-latest-chomium-and-google-canary –