Reputation: 723
We have a Java based web application deployed on WebLogic. We provide direct links to some PDF files, which the users can download/ open in their browser. Our security team is claiming that to allow opening PDF files in the browser is a security risk. So they want to force the users to download the PDF files first rather than opening them in the browser window.
Is this really a security risk?
If the PFD is a trogen/ vulnerable, how come downloading the file first and opening it could solve the problem?
Is their a way to programmatically prevent the user from opening the PDF files in the browser window and to force downloading the PDF files first?
Upvotes: 1
Views: 1201
Reputation: 21
To force the browser to give download option to the PDF :
response.setHeader ("Content-Disposition", "attachment;filename=\"" + filename + "\"");
Upvotes: 1
Reputation: 991
Forcing the user to save a PDF file first and then open it is actually likely to be more risky than allowing it to be opened in the browser.
It's not better:
But it might be worse:
Upvotes: 0