-1

Is it possible to hide the url that a browser is trying to resolve? Basically my requirement is to hide a particular download link to a file when the user clicks on it. Is it possible in any way? Either at code level or at server/browser configuration level, anything.

Arnav Sengupta
  • 423
  • 1
  • 7
  • 19
  • Why not just deny access to the file from anyone? (Apache) `Deny From All` (Unsure on how to do it with Nginx) – ʰᵈˑ Jul 02 '14 at 14:29
  • duplicate: http://stackoverflow.com/questions/10997516/how-to-hide-the-actual-download-folder-location and http://stackoverflow.com/questions/17533806/hide-download-url – JaMaBing Jul 02 '14 at 14:35
  • 2
    What is the specific/real problem that you're ultimately trying to solve here? – Patrick Q Jul 02 '14 at 14:36
  • Even if you visibly do not display the download link, I can just look at my HTTP request and find the link. It is not hard. If you want to not let everyone download your file, then set a link that allow only one download, and limit your downloads that way. – dayuloli Jul 02 '14 at 14:44

1 Answers1

0

http://jsfiddle.net/aE7s9/1/

    var i = 10,
  time;
function E(id) {return document.getElementById(id) }
E('myInput').onclick = function () {
  E('imageoef').style.visibility = 'visible';
  E('link').style.visibility = 'hidden';
  time = setInterval(function () {
    i--;
    E('countdown').innerHTML = i;
    if (i < 1) {
      clearInterval(time);
      E('countdown').innerHTML = '';
      E('imageoef').style.visibility = 'hidden';
      E('link').style.visibility = 'visible';
    }
  }, 1000);
}

<img src="images/loading.gif" alt="Loading..." id="imageoef" style="visibility:hidden"
/>
<form method="post">
  <input id="myInput" type="button" value="start download" />
</form>
<div id="countdown"> 
</div><a id="link" href="http://freelanceswitch.com/freelance-freedom/freelance-freedom-2/">Your download is ready!</a>

Found this Javascript Download Link Example

It Offers a link to download which then is removed after a specified period of time.

DD84
  • 383
  • 1
  • 6
  • 15