Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all...,
Please help me........
how to avoid to user the files cannot copy and download from application. he can just read.
i am providing some informations in pdf and html files format in my application but i want to user not able to copy and download the files.


Thanks in advance....
Posted

C#
$(document).ready(function(){
    document.oncontextmenu = function() {return false;};
});



remember include jquery library
 
Share this answer
 
Comments
dA.d 22-May-12 0:48am    
Thanks for replay.....
can u explain in detail for this javascript.
how can i use in my page....
no way to stop copy if viewer is any computer technical

but for normal user you can add attribute on body tag of your html page
i.e.

HTML
<body oncontextmenu="return false;" onselectstart="return false;" onkeydown="return false;">
</body>


and many more if it works
 
Share this answer
 
for html , you can use javascript to block right click
I don't know how to deal with PDF
 
Share this answer
 
Comments
dA.d 22-May-12 0:38am    
Thanks for replay......

can u show me javascript code for preventing for copy the text from file.
Clifford Nelson 22-May-12 0:39am    
How about providing information on how to do it with JavaScript. Link to an article would have been very helpful.

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