This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Restrict saving of Word Document Opened in browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Restrict saving of Word Document Opened in browser" Watch "Restrict saving of Word Document Opened in browser" New topic
Author

Restrict saving of Word Document Opened in browser

Sivaraman Lakshmanan
Ranch Hand

Joined: Aug 02, 2003
Posts: 231
Hi All,
I stream a MS Document file(Word, XL, PPT) to the client and the client is able to see the file in the browser but I want to restrict the save, print and CTRL+A for this document.
I am using Tomcat server and my OS is Windows XP. Someone please pour light on this.
Any help on this topic is very much appreciated.


Regards,
Sivaraman.L
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

There is nothing you can do on the server to keep Word from allowing the user to save the document to his local machine.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Sivaraman Lakshmanan
Ranch Hand

Joined: Aug 02, 2003
Posts: 231
Hi Ben,
Thanks for replying. Is there any other way I can do this. I just want the user only to see the document and not to do anything with that document.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Word docs are meant to be edited.
You may want to consider PDF.

Even still there is little you can do to keep them from saving a copy.
If determined enough, a user could take a screenshot of each page.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

In a browser, the user can right-click on a link and see a "Save As..." option to save the response as a file. There's nothing you can do to prevent the user from using that option.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Restrict saving of Word Document Opened in browser
 
Similar Threads
Content (MIME)type in websphere
Opening a MS Word Document from JSP using Relative URL
Popping up MS Word in my application
open word from a servlet
Is it possible to open a word document in client side by javascript?