
How can I protect my Web site graphics?How can I protect my website html pages, graphics, etc. from being viewed, and/or manipulated by casual viewers? IOW, what do I need to set up so that if someone tries to go to "www.mysite.com/pics" (for example), they would get a "no permission" message? There are two ways I can try to answer your question, actually. There's the far more complex question of how do you protect the content of your pages from prying eyes, and there's the simple question of how do you make it so people can't browse your "images" or "pics" directory. Let's start with the first one. The essentially answer is that you cannot prevent people from manipulating your page, viewing the source HTML, JavaScript, CSS, etc., and even right-clicking on a graphic and using "Save Image As..." to grab a copy of what you have. There are ways you can make it more difficult, including a common snippet of JavaScript code that disables the right-click feature while someone is on your page, but as with everything else that the Web site developer lives with, this is a case of "it's up to the browser". Specifically, if you can get something to appear on someone's screen, then they can take a screenshot, scrape the site with an archive program, or even browse their Web browser cache to get a copy of the image. For that matter, they can also ascertain the URL of your image and just reference that in an img src tag! Here's a simple right click disable JavaScript snippet, by way of example: <script language="Javascript1.2">
alertMsg = "Right-clicking on this page is disabled!"; browserVersion = parseInt(navigator.appVersion) function noRightClick(evnt) { document.onmousedown = noRightClick; </script> So that, as I said, is the complex half of this question. The simple half is, well, simpler! If you want to prevent people from browsing your "pics" folder, simply create an empty file called "index.html" and drop it in that folder. If someone tries to browse the folder, they jsut get a blank page, but you can manipulate its contents to your heart's content using sftp or ftp. Hope that helps you out!
Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Simpy.
Categorized:
HTML and CSS
(Article 4204)
Tagged: Previous: How do I export MP3 files from iTunes? Next: How do I use IRC on a Mac? Subscribe!
Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader. Another thing to do is to disable the directory listing in the web server software. Not everyone will have system administrator priviledge to do that, but if you do, it's a really simple setting. Disabling right click with Javascript is, in my opinion, an obnoxious nuisance! For instance, if I click the middle mouse button to scroll with Firefox, I get the "no right-click" popup. It's more useful for the site designer to disable hotlinked images than to prevent direct viewing of them. Just my two cents. Posted by: Chris Hepner at October 21, 2006 6:00 PMhttp://ankurkhetrapal.com/blog/2008/01/12/protecing-your-images-on-the-web/ the author has discussed some neat methods to make image theft inconvenient Posted by: chris at March 7, 2008 4:41 PMI have a lot to say, but ...
I do have a comment, now that you mention it!
|
![]() Join Me At:
Search
Find just the answers you seek from among our 1700+ free tech support articles by using our Lijit search engine.
Help!
Subscribe to
Ask Dave Taylor!
Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.
Articles and Reviews
Auctions and Online Shopping Blogs and RSS Feeds Building Web site traffic Business and Management Cell Phones and Mobile Phones CGI Scripts and Web Site Programming Computer and Internet Basics d) None of the Above HTML and CSS Mac OS X Help MySpace, Facebook, Twitter and Social Network Help Pay Per Click (PPC) Search Engine Optimization Shell Script Programming Sony PSP, MP3 Players, Etc. The Writing Business Unix and Linux Help Video Game Tips and Help Windows Help
Recent Entries
Join the List!
Book Links
|