Click here to Skip to main content
15,746,652 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,

in my application (pdf,doc,docx)file are there ,when u click particular file that file will be opened in browser,instead of downloading that file and here we can restrict that file to save,cut,copy,paste.

please replay to me if u know any links or plugins available
Updated 19-Jul-12 18:54pm
ZurdoDev 19-Jul-12 10:11am    
You have to use whatever security permissions are with the file type. Use Word to lock down those that are Word files and you'll have to use Adobe or some other tool to lock down pdfs.

1 solution

Content disposition[^] is actually an advice to the browser. With attachment will prompt file for saving, but inline can be presented only if a proper plugin of that browser is present, the browser is able and configured to use inline viewing. You will be not able to prevent saving of files presented in this way. The ability to edit a file depends on the permissions present in the file and the application opening it. PDF has built-in features to prevent copy and paste, Word and Excel have also such features. But there are unlockers and password recovery tools out there... The only approach that can really harden against unwanted operations, is to convert the document in a segmented image format and present it on the web page using a plugin, or a properly tailored javascript application (like google maps presents the satellite images). The problem is, that you need to convert the document to image, and that is not always easy.
Keep in mind, what you allow the browser to get from your server, that is already on client side, and is exposed to the user.
Share this answer
sunil from Chennai 20-Jul-12 1:10am    
Thanks for u r replay

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900