473,546 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

restricting non asp.net files while using form authentication

hi,

I have a web application using forms based authentication. I want to
restrcit even the non asp.net files from forms authentication i.e I do not
want that my clients should be able to access the word files, ,xls, pdf etc
from outside project. Actually these files appear as links like :
http://hp-amit/testfolder/abc.doc

now if i copy this link and directly type this without loging on to the site
it would still access it. whereas if i try an access any other ASPX page, it
redirects to the login page.
One way of solving this is that I edit the IIS Mappings to support these
files but I want to use it programmaticall y thru code and not thru IIS.

If there is no other viable solution, Is there a script available which can
be executed to automate this task/

thanks in advance.

bye
amit purohit


Nov 18 '05 #1
2 1287
in your web.config for that application..tr y this

<httpHandlers >
<add verb="*" path="*.doc" type="System.We b.HttpForbidden Handler"/>
</httpHandlers>

Av.

"amit" <am**********@r systems.com> wrote in message
news:eH******** ******@TK2MSFTN GP12.phx.gbl...
hi,

I have a web application using forms based authentication. I want to
restrcit even the non asp.net files from forms authentication i.e I do not
want that my clients should be able to access the word files, ,xls, pdf
etc
from outside project. Actually these files appear as links like :
http://hp-amit/testfolder/abc.doc

now if i copy this link and directly type this without loging on to the
site
it would still access it. whereas if i try an access any other ASPX page,
it
redirects to the login page.
One way of solving this is that I edit the IIS Mappings to support these
files but I want to use it programmaticall y thru code and not thru IIS.

If there is no other viable solution, Is there a script available which
can
be executed to automate this task/

thanks in advance.

bye
amit purohit

Nov 18 '05 #2
hi,

even then i would have to do IIS mappings, I want to move away from this
problem of configuring IIS for extensions or what I can instead do is
automate this job, but for that I would need a script ,

thanks for the prompt reply last time ,
bye
amit
"avnrao" <av*@newsgroups .com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
in your web.config for that application..tr y this

<httpHandlers >
<add verb="*" path="*.doc" type="System.We b.HttpForbidden Handler"/>
</httpHandlers>

Av.

"amit" <am**********@r systems.com> wrote in message
news:eH******** ******@TK2MSFTN GP12.phx.gbl...
hi,

I have a web application using forms based authentication. I want to
restrcit even the non asp.net files from forms authentication i.e I do not want that my clients should be able to access the word files, ,xls, pdf
etc
from outside project. Actually these files appear as links like :
http://hp-amit/testfolder/abc.doc

now if i copy this link and directly type this without loging on to the
site
it would still access it. whereas if i try an access any other ASPX page, it
redirects to the login page.
One way of solving this is that I edit the IIS Mappings to support these
files but I want to use it programmaticall y thru code and not thru IIS.

If there is no other viable solution, Is there a script available which
can
be executed to automate this task/

thanks in advance.

bye
amit purohit


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
959
by: Andrew Banks | last post by:
I have some directory's in my web site which I only want to give users with a role of "management" access to. I have assigned the roles allready. Is it possible to control this using my web.config file? My current web.config file contains the code below, which makes sure users need to be logged in to access any files at all. I just want to...
1
1133
by: Justin | last post by:
I am trying to create an admin area for a web site using the authentication tags in the web.config file the problem is I do NOT want to restrict access to the entire site. How do can I require authentication for some pages and not others? Thanks, Justin.
6
2130
by: Mr Newbie | last post by:
Hi, Im in a situation where I need to restrict users, but I dont have access or wont be allowed access to manage groups in the domain. How can I restrict access is this case ? -- Best Regards
5
2791
by: nick | last post by:
I need to create a simple asp.net application that use password protect some html pages. The html page provider doesn't know asp.net. And the host doesn't allow me to create user accounts. What's the best way to store users/password except database tables? and to store html files?
2
3072
by: nick | last post by:
I have an Asp.Net 2.0 application using form authentication. I want the html pages be protected by the authentication system too. The accessing of html files need to be authenticated in my local system. However, it doesn't after I uploaded the files to my web host site. Any setting to modify to make my hosting html files need to be...
0
988
by: WebMatrix | last post by:
Hello, What's the best way to keep email templates as html files on the server, so ASP.NET application can get file access to it, while restricting web users from accessing it through their browsers. The site is open to the public, no authentication is required, and web application runs under default iis user account. Thanks!
1
1363
by: Ann | last post by:
Hi all, My prj has a login form(Login.aspx).It uses Form authentication(Credential stored in web.config).Once user is authenticated,it redirects to a webservice(service.asmx) that has a method that does some database operation. this is the code.. if (FormsAuthentication.Authenticate(UsrNameTextBox.Text, PwdTextBox.Text))...
1
1433
by: Paul Aspinall | last post by:
Hi I want to have most of my website available to users without any authentication (ie. they can freely browse). However, if they go to a restricted part, they should be redirected to a login page, and then authenticated. I don't want to use SQL Server, as I would have to pay for that with my host. I would prefer to use Access, or even a...
10
1682
by: KBTibbs | last post by:
Hi. I'm restricting access to my webpage with forms authentication, but I have some .htm files that I want to restrict as well (by default, ASP.NET does not restrict this, so anyone with access to the URL could open them). I've run across a number of solutions on the web, none however seem to work for me. It's possible I'm just missing...
0
7435
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7698
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7461
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7794
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5080
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1922
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.