• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Sandeep Swaminathan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 >
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to HTML/JavaScript. This isn't a Struts question.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64718
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic