2

この pdf.js https://github.com/mozilla/pdf.js/ ライブラリを使用して、自分のサイトで pdf ファイルをレンダリングします。すべて正常に動作しますが、Amazon s3 からファイルを読み取ろうとすると動作しませんでした。

PDF ファイルをサーバーに配置すると正常に動作しますが (assets/books/my.pdf)、別のサーバーに配置すると動作しませんでした。たとえば、Amazon s3 の私のファイル: s3.amazonaws.com/MYBUCKET/MYBOOK.pdf

何か案は ?ありがとう ..

4

1 に答える 1

1

I'ts a cross-domain issue with javascript

I did it with mod_rewrite with this simple code :

RewriteRule ^MAGIC-FOLDER/(.*)$ http://BUCKET.s3.amazonaws.com/$1 [P]

so in my js file I just make the linke like this :

MAGIC-FOLDER/MY.PDF

he will get the file from amazon s3 :

http://BUCKET.s3.amazonaws.com/MY.PDF

actually there is no folder in my server with this name "MAGIC-FOLDER"

-_^

于 2012-06-01T01:21:30.793 に答える