title: How do I serve a downloadable file online without exposing the physical path?
body: <p>I'm serving up documents that require the user to register before download. Currently, once you register and login, the links to the documents are displayed as:</p>
  
  <pre><code>myurl.com/docs/mypdf.pdf
  </code></pre>
  
  <p>So the physical path to the document is exposed to anyone logged in. What is the best practice for keeping the physical path to the document hidden so registered users can't share direct links with unregistered users or post direct links to the documents elsewhere?</p>
  
  <p><strong>EDIT:</strong> I was just looking for an idea that was language agnostic so I chose a few of my favorite languages for the tags. The actual implementation in this case is ASP classic. I'm currently using a download wrapper script that confirms the user is logged in before redirecting to the actual document URL. I just didn't include it in my question for simplicity. </p>