Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement progressive pdf download #53

Closed
libreliodev opened this issue Jun 18, 2014 · 10 comments
Closed

Implement progressive pdf download #53

libreliodev opened this issue Jun 18, 2014 · 10 comments

Comments

@libreliodev
Copy link
Owner

When we try to download http://librelio-europe.s3.amazonaws.com/librelio/wind/wind_355/wind_355.pdf in Firefox, progressive download works.
When using our PDF reader with the same file (Wind 355) , progressive download does not work.

@AlirezaAlgo
Copy link
Collaborator

@libreliodev Firefox pdf reader does not care about CORS setting of your s3 bucket.
You should change CORS setting. Look at my comments in #44

@libreliodev
Copy link
Owner Author

@serverfire Thank you for your comment.

As mentioned in #44 , CORS is already in place on this bucket. In order to understand which authorizations are potentially missing, do you have an error message in javascript?

@libreliodev
Copy link
Owner Author

@libreliodev
Copy link
Owner Author

This might also help: mozilla/pdf.js#3150

@libreliodev
Copy link
Owner Author

For some reason, this now works under Firefox and Chrome, but not Safari.
Will need to test under IE.

@AlirezaAlgo
Copy link
Collaborator

@libreliodev I saw that. It's mostly likely because of CORS setting or the browser does not allow that.
Now i see this response in header.
Access-Control-Expose-Headers: Accept-Ranges, Content-Encoding, Content-Length, Content-Range
It means ajax request can use these request headers. Maybe if you set * is allowed. It will fix safari problem.

@libreliodev
Copy link
Owner Author

@serverfire: thanks for the suggestion. However, it's not possible to do this in AWS

ExposeHeader "*" contains wildcard. We currently do not support wildcard for ExposeHeader.

Any idea of the missing header(s)?

@AlirezaAlgo
Copy link
Collaborator

I think that's enough. I should see if safari supports partial requests via ajax.

AlirezaAlgo added a commit that referenced this issue Jun 18, 2014
@AlirezaAlgo
Copy link
Collaborator

@libreliodev Now safari also requests for pdf file partially.

@libreliodev
Copy link
Owner Author

@serverfire Fantastic. Many thanks.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants