aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Disable right click, copy & paste option in <html:file> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Disable right click, copy & paste option in <html:file>" Watch "Disable right click, copy & paste option in <html:file>" New topic
Author

Disable right click, copy & paste option in <html:file>

Sandeep Swaminathan
Ranch Hand

Joined: Apr 23, 2008
Posts: 52
By using onkeydown="this.blur()" I'm able to restrict the user to enter to enter the pathname manually but I'm able to copy paste the location of the file. How do I disable it so that the user is only forced to click the browse button and choose a file to upload?

Note: Browse button logic I have implemented. No probs in that >


Music is all around us. All you have to do is just LISTEN to it,
Sandeep Swaminathan
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Moving to HTML/JavaScript. This isn't a Struts question.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Just make sure you do not kill keyboard navigation, not everyone uses a mouse.

It is impossible to block all of these operations since you can not block Edit --> Paste and some others.

Some browsers do not even let you type it in anymore.

Is it too hard to put validation on the server to say hey the file did not exist when it fails?

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

Please read this.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Disable right click, copy & paste option in <html:file>