Hi All,
I am trying to hide an XML file in my ASP.NET 2.0 application so users cannot type the URL in the address bar and view it. I have read up and it seems the best way is to use the web.config file to hide files or folders. This is what I have done - I have tried to hide at folder level:
Code:<location path="secret"> <system.web> <authorization> <deny users="*" /> </authorization> </system.web> </location>
I've put 2 files in a folder called secret (referenced by the code above), called secret.aspx and hideme.xml
The security works as expected for the secret.aspx file - i.e. it asks for authentication, and won't let me in when I try to view secret.aspx. However, when I type the url for the XML file (hideme.xml), it just shows me the file contents as normal.
I have even tried to hide the at file level:
But this doesn't work also.Code:<location path="secret/hideme.xml"> <system.web> <authorization> <deny users="*" /> </authorization> </system.web> </location>
Can anyone please shed light on this problem? I'd be very grateful.
Much Obliged, Ash
UK




























Bookmarks