Asp.net mvc restrict specific users to access folder content
<p>I am trying to restrict users(except admin)   to access my folder images. For example the path is:</p>

<pre><code>~/content/images/coverBeg.jpg
</code></pre>

<p>If the user navigates to  <code>domain/content/images/coverBeg.jpg</code>, he can see the file.
I've tryied different sort of things but none of them  worked for me. In web config file i've added :</p>

<pre><code>    &lt;location path="~/content/images"&gt;
    &lt;system.web&gt;
      &lt;authorization&gt;
        &lt;allow roles="Admin"/&gt;
        &lt;deny users ="*" /&gt;
      &lt;/authorization&gt;
    &lt;/system.web&gt;
  &lt;/location&gt;
</code></pre>

<p>With no success. After that i've added a web config file to images folder and add those lines of code :</p>

<pre><code>&lt;?xml version="1.0"?&gt;
&lt;configuration&gt;

    &lt;system.web&gt;
      &lt;authorization&gt;
        &lt;allow roles="Admin"/&gt;
        &lt;deny users ="*" /&gt;
      &lt;/authorization&gt;
    &lt;/system.web&gt;

&lt;/configuration&gt;
</code></pre>

<p>Neither this worked for me. Still everyone can access coverBeg.jpg file</p>