Using HttpHandler to catch right-click requests
-
Hello, Excuse the re-post - I asked this a few weeks ago, but stupidly on a Sunday, and got no response, so trying again... I have cribbed an HttpHandler class to protect certain files on my website, very much along the lines of this article[^]... (in fact extended to include Word docs, Zip files etc, but the essential code is the same.) All works fine but for one thing: If a logged-in user clicks a link to, say, a Word doc, it will open in a new window, and they can then use "File/Save As.." to download it onto their computer. That's fine. But if they right-click the link and choose "Save target as.." and try to save it like that, they will get an "Access denied" message (or "no.jpg" in the example code I linked to.) What do I need to alter in the code to allow this, without compromising the rest of it? Presumably, right-clicking means that context.Request.ServerVariables["HTTP_REFERER"] returns null/Nothing.... what else could I use to check for this? thanks for any ideas.. P