title: About disabling directory listing in web.config
body: <p>I have disabled directory listing in a folder (named Documents) in my asp.net project with web.config settings below.</p>
  
  <p>It works and <a href="http://mywebsite.com/Documents/" rel="nofollow">http://mywebsite.com/Documents/</a> does not list the files. But I want the user open a file from this location. For example this link <a href="http://mywebsite.com/Documents/file.pdf" rel="nofollow">http://mywebsite.com/Documents/file.pdf</a> also gives error. </p>
  
  <p>Is it possible to open a file from a directory which does not allow directory listing. Thanks in advance.</p>
  
  <pre><code>&lt;configuration&gt;
  &lt;system.webServer&gt;
     &lt;directoryBrowse enabled="false" /&gt;
  &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>