File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Restrict Users to Download PDF

 
ankit maini
Greenhorn
Posts: 25
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I am making a small project in jsp and servlet. There are three users visitor member and admin in my website. Admin Upload the PDF File into to folders
1st in myWebApp\pdf\member for Members
2nd in myWebApp\pdf\visitor for visitor

Now I want visitor to restrict to view or download the member's pdf.

How can I do this ?
Is it possible with filters if yes then how??
Is there any another way ??
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the directories are different you could set up servlet security as defined in the web.xml file. That would restricting the pdf\member directory to logged-in users.
 
ankit maini
Greenhorn
Posts: 25
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to apply the security in web.xml could you please specify .
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64178
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you read the security section in the Servlet Specification? If so, what part are you having trouble with? if not, then that's your next step.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic