Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have my XML files on Server.
path : root\Myfolder\.xml files
I am using IIS 6, it has Read and write permissions as they are used to store Logs and some Data.

It all work fine, But Suppose i Type www.mydomain.com\Myfolder\abc.xml it shows all the contains of the file.
How can i Restrict it so it will display some message suppose FOBIDDEN Message..

Prathamesh
Posted

1 solution

Add a Web.Config file to the folder:
XML
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.web>
        <authorization>
            <deny users="*" />
        </authorization>
    </system.web>
</configuration>
 
Share this answer
 
Comments
prathameshpitale 11-Sep-11 7:17am    
I created web.config File in that folder. But it still shows the content of that file...
OriginalGriff 11-Sep-11 7:31am    
Try adding
<authentication mode="Forms">
to the system.web section of your root folder web.config.
If that doesn't work, you may have to enable Authentication properly, following the instructions on MSDN.
prathameshpitale 11-Sep-11 9:27am    
I Added deny user tag into web.config file of root folder.
the Total web application was Denied to Run..

I need only that folder should be denied.
OriginalGriff 11-Sep-11 9:35am    
Not, don't deny user to the root - you will never get in with anything.
See my comment again - I had to force the site to leave the tag visible (it ate it as real HTML last time)
prathameshpitale 11-Sep-11 9:38am    
can you please give me a example or tutorial Link?
I found Some similar Article
http://support.microsoft.com/kb/815174
But cant Decide how should i provide path to Location TAG
<location path="”Default" web="" site="" myapp”="" allowoverride="”false”">

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900