Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deny access to folder or file [duplicate]

I have an ASP.NET website and I need to block a specific folder named /swf.

This folder have a lot of swf files that cannot be accessed from unauthenticated users.

Ideas?

like image 409
Beginner Avatar asked Dec 27 '22 22:12

Beginner


1 Answers

Consider using the configuration/location nodes in your web.config. Details on MSDN

<configuration>
    <location path="MySubDirectory">
        <system.web>
            <authorization>
                <deny users="*"/> <!-- Denies all users -->
            </authorization>
        </system.web>
    </location>
</configuration>
like image 98
p.campbell Avatar answered Jan 20 '23 11:01

p.campbell