473,586 Members | 2,463 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

forms-based authentication

Vic
I am trying to implement a forms-based authentication on my website, so some
directories will have web.config file which will deny certain users, based
on role, etc. The problem I encountered is that it's only asp.net files (or
the files with the extension mapped to aspnet_isapi.dl l) are the ones being
secured.

The solution I found is to map all of the extension I'd keep in my secured
directory to aspnet_isapi.dl l.

I am planning to map .htm, *.exe, and *.shtm files to be processed by .NET.
How is it going to affect the performance of the site? Is there another way
of achieving the same thing?

Thanks,
Vic
Nov 17 '05 #1
9 1235
I accomplished this in a recent project by putting other files in a private
directory.
Then when I needed to send one of the files to the user, I'd use
Response.WriteF ile to grab the file from the private directory and output it
to the user. Of couse the ASPNET user account needs read access to the
private directory.
I used code similar to this:
Response.Clear( );
Response.AddHea der("Content-Disposition","i nline;filename= myfile.doc");
Response.WriteF ile("c:\private dir\myfile.doc" );

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com


"Vic" <ro****@gat.com > wrote in message
news:uB******** ******@TK2MSFTN GP12.phx.gbl...
I am trying to implement a forms-based authentication on my website, so some directories will have web.config file which will deny certain users, based
on role, etc. The problem I encountered is that it's only asp.net files (or the files with the extension mapped to aspnet_isapi.dl l) are the ones being secured.

The solution I found is to map all of the extension I'd keep in my secured
directory to aspnet_isapi.dl l.

I am planning to map .htm, *.exe, and *.shtm files to be processed by ..NET. How is it going to affect the performance of the site? Is there another way of achieving the same thing?

Thanks,
Vic

Nov 17 '05 #2
"Vic" <ro****@gat.com > wrote in message
news:uB******** ******@TK2MSFTN GP12.phx.gbl...
I am trying to implement a forms-based authentication on my website, so some directories will have web.config file which will deny certain users, based
on role, etc. The problem I encountered is that it's only asp.net files (or the files with the extension mapped to aspnet_isapi.dl l) are the ones being secured.

The solution I found is to map all of the extension I'd keep in my secured
directory to aspnet_isapi.dl l.

I am planning to map .htm, *.exe, and *.shtm files to be processed by ..NET. How is it going to affect the performance of the site? Is there another way of achieving the same thing?


The only way to find out how it performs is to try it.

As a general statement, consider that it shouldn't be any worse than the
performance of processing ASP.NET files, which have to deal with executing
code and possibly even compiling it.

One thing to be aware of: the StaticFileHandl er which ASP.NET uses for these
file types seems to read the entire file into memory before sending it out.
This can be an issue for huge files...
--
John
Nov 17 '05 #3
Vic
Thanks, John.

I think it's not such a hot idea, since some of the files are more than
20MB...

I'll probably use Steve's approach:
Response.WriteF ile("c:\private dir\myfile.doc" );

Of course, this could also load the file in the memory first...

Thanks,
Vic

"John Saunders" <john.saunder s at surfcontrol.com > wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
"Vic" <ro****@gat.com > wrote in message
news:uB******** ******@TK2MSFTN GP12.phx.gbl...
I am trying to implement a forms-based authentication on my website, so some
directories will have web.config file which will deny certain users, based on role, etc. The problem I encountered is that it's only asp.net files

(or
the files with the extension mapped to aspnet_isapi.dl l) are the ones

being
secured.

The solution I found is to map all of the extension I'd keep in my secured directory to aspnet_isapi.dl l.

I am planning to map .htm, *.exe, and *.shtm files to be processed by

.NET.
How is it going to affect the performance of the site? Is there another

way
of achieving the same thing?


The only way to find out how it performs is to try it.

As a general statement, consider that it shouldn't be any worse than the
performance of processing ASP.NET files, which have to deal with executing
code and possibly even compiling it.

One thing to be aware of: the StaticFileHandl er which ASP.NET uses for

these file types seems to read the entire file into memory before sending it out. This can be an issue for huge files...
--
John

Nov 17 '05 #4
Vic
Thanks, Steve.

It sure does help...

Vic

"Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
I accomplished this in a recent project by putting other files in a private directory.
Then when I needed to send one of the files to the user, I'd use
Response.WriteF ile to grab the file from the private directory and output it to the user. Of couse the ASPNET user account needs read access to the
private directory.
I used code similar to this:
Response.Clear( );
Response.AddHea der("Content-Disposition","i nline;filename= myfile.doc");
Response.WriteF ile("c:\private dir\myfile.doc" );

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com


"Vic" <ro****@gat.com > wrote in message
news:uB******** ******@TK2MSFTN GP12.phx.gbl...
I am trying to implement a forms-based authentication on my website, so

some
directories will have web.config file which will deny certain users, based on role, etc. The problem I encountered is that it's only asp.net files

(or
the files with the extension mapped to aspnet_isapi.dl l) are the ones

being
secured.

The solution I found is to map all of the extension I'd keep in my secured directory to aspnet_isapi.dl l.

I am planning to map .htm, *.exe, and *.shtm files to be processed by

.NET.
How is it going to affect the performance of the site? Is there another

way
of achieving the same thing?

Thanks,
Vic


Nov 17 '05 #5
Vic
Steve.

Is there an easy way to simulate the Save As behavior with
Response.WriteF ile() ? I want user to prompted with the Save As dialog and
the file to be downloaded to the specified location on user's PC, instead of
dumping it into the page.

Thanks in advance.

Vic
"Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
I accomplished this in a recent project by putting other files in a private directory.
Then when I needed to send one of the files to the user, I'd use
Response.WriteF ile to grab the file from the private directory and output it to the user. Of couse the ASPNET user account needs read access to the
private directory.
I used code similar to this:
Response.Clear( );
Response.AddHea der("Content-Disposition","i nline;filename= myfile.doc");
Response.WriteF ile("c:\private dir\myfile.doc" );

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com


"Vic" <ro****@gat.com > wrote in message
news:uB******** ******@TK2MSFTN GP12.phx.gbl...
I am trying to implement a forms-based authentication on my website, so

some
directories will have web.config file which will deny certain users, based on role, etc. The problem I encountered is that it's only asp.net files

(or
the files with the extension mapped to aspnet_isapi.dl l) are the ones

being
secured.

The solution I found is to map all of the extension I'd keep in my secured directory to aspnet_isapi.dl l.

I am planning to map .htm, *.exe, and *.shtm files to be processed by

.NET.
How is it going to affect the performance of the site? Is there another

way
of achieving the same thing?

Thanks,
Vic


Nov 17 '05 #6
"Vic" <ro****@gat.com > wrote in message
news:O9******** *****@TK2MSFTNG P11.phx.gbl...
Thanks, John.

I think it's not such a hot idea, since some of the files are more than
20MB...

I'll probably use Steve's approach:
Response.WriteF ile("c:\private dir\myfile.doc" );

Of course, this could also load the file in the memory first...


Victor,

In a similar case, I wrote a asynchronous HttpHandler (implementing
IHttpAsyncHandl er) to handle product downloads from our site. I found the
following article very helpful in that:

Use Threads and Build Asynchronous Handlers in Your Server-Side Web Code
(http://msdn.microsoft.com/msdnmag/is.../default.aspx).

I hope that helps,
John
Nov 17 '05 #7
change inline to attachment on the Response.Addhea der line.
Like this:
Response.AddHea der("Content-Disposition","a ttachment;filen ame=myfile.doc" );

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Vic" <ro****@gat.com > wrote in message
news:ul******** *****@TK2MSFTNG P10.phx.gbl...
Steve.

Is there an easy way to simulate the Save As behavior with
Response.WriteF ile() ? I want user to prompted with the Save As dialog and
the file to be downloaded to the specified location on user's PC, instead of dumping it into the page.

Thanks in advance.

Vic
"Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
I accomplished this in a recent project by putting other files in a private
directory.
Then when I needed to send one of the files to the user, I'd use
Response.WriteF ile to grab the file from the private directory and output it
to the user. Of couse the ASPNET user account needs read access to the
private directory.
I used code similar to this:
Response.Clear( );
Response.AddHea der("Content-Disposition","i nline;filename= myfile.doc");
Response.WriteF ile("c:\private dir\myfile.doc" );

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com


"Vic" <ro****@gat.com > wrote in message
news:uB******** ******@TK2MSFTN GP12.phx.gbl...
I am trying to implement a forms-based authentication on my website,
so some
directories will have web.config file which will deny certain users, based on role, etc. The problem I encountered is that it's only asp.net
files (or
the files with the extension mapped to aspnet_isapi.dl l) are the ones

being
secured.

The solution I found is to map all of the extension I'd keep in my secured directory to aspnet_isapi.dl l.

I am planning to map .htm, *.exe, and *.shtm files to be processed by

.NET.
How is it going to affect the performance of the site? Is there

another way
of achieving the same thing?

Thanks,
Vic



Nov 17 '05 #8
Vic
Thanks Steve. It works perfectly.

Vic
"Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message
news:Ol******** ******@TK2MSFTN GP12.phx.gbl...
change inline to attachment on the Response.Addhea der line.
Like this:
Response.AddHea der("Content-Disposition","a ttachment;filen ame=myfile.doc" );
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Vic" <ro****@gat.com > wrote in message
news:ul******** *****@TK2MSFTNG P10.phx.gbl...
Steve.

Is there an easy way to simulate the Save As behavior with
Response.WriteF ile() ? I want user to prompted with the Save As dialog and
the file to be downloaded to the specified location on user's PC,
instead of
dumping it into the page.

Thanks in advance.

Vic
"Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
I accomplished this in a recent project by putting other files in a

private
directory.
Then when I needed to send one of the files to the user, I'd use
Response.WriteF ile to grab the file from the private directory and

output
it
to the user. Of couse the ASPNET user account needs read access to the private directory.
I used code similar to this:
Response.Clear( );
Response.AddHea der("Content-Disposition","i nline;filename= myfile.doc"); Response.WriteF ile("c:\private dir\myfile.doc" );

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com


"Vic" <ro****@gat.com > wrote in message
news:uB******** ******@TK2MSFTN GP12.phx.gbl...
> I am trying to implement a forms-based authentication on my website,

so some
> directories will have web.config file which will deny certain users,

based
> on role, etc. The problem I encountered is that it's only asp.net files (or
> the files with the extension mapped to aspnet_isapi.dl l) are the ones being
> secured.
>
> The solution I found is to map all of the extension I'd keep in my

secured
> directory to aspnet_isapi.dl l.
>
> I am planning to map .htm, *.exe, and *.shtm files to be processed by .NET.
> How is it going to affect the performance of the site? Is there another way
> of achieving the same thing?
>
> Thanks,
> Vic
>
>



Nov 17 '05 #9
Vic
Thanks John.

I read article -- it sure does make sense making those downloads a separate
thread.

Vic
"John Saunders" <john.saunder s at surfcontrol.com > wrote in message
news:ef******** ******@TK2MSFTN GP11.phx.gbl...
"Vic" <ro****@gat.com > wrote in message
news:O9******** *****@TK2MSFTNG P11.phx.gbl...
Thanks, John.

I think it's not such a hot idea, since some of the files are more than
20MB...

I'll probably use Steve's approach:
Response.WriteF ile("c:\private dir\myfile.doc" );

Of course, this could also load the file in the memory first...


Victor,

In a similar case, I wrote a asynchronous HttpHandler (implementing
IHttpAsyncHandl er) to handle product downloads from our site. I found the
following article very helpful in that:

Use Threads and Build Asynchronous Handlers in Your Server-Side Web Code
(http://msdn.microsoft.com/msdnmag/is.../default.aspx).

I hope that helps,
John

Nov 17 '05 #10

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

Similar topics

3
2275
by: Joshua Russell | last post by:
Hi, Both the methods below open up a windows form called MasterForm. However, one works better than the other. Method 1 opens the form correctly but I don't have any reference to the instance of master form. Method 2 opens the form but when I right click on the Notify Icon I don't get the context menu that I should be seeing. I can interact with...
7
2466
by: Mike Bulava | last post by:
I have created a base form that I plan to use throughout my application let call the form form1. I have Built the project then add another form that inherits from form1, I add a few panel controls each with a couple of controls in them I then rebuilt my project and my new panels and all controls they contained are gone... I've looked through...
13
5562
by: MD | last post by:
I have been converting a program from VB6 to VB.Net and enhancing it as well. All has been progressing OK although its been hard work. Now, all of a sudden, when I try to execute a ShowDialog() on one of my forms I get "An unhandled exception of type 'System.ExecutionEngineException' occurred in system.windows.forms.dll". I can't work out...
3
1632
by: Lloyd Sheen | last post by:
I have the following situation: Need a user resizable user control. After much trying with user control I came across the idea of hosting the controls in a form marked as not TopLevel = false. This work fine for most cases, allowing the user to resize the form (and controls within the form. The forms them selves are create dynamically...
3
2364
by: Geraldine Hobley | last post by:
Hello, In my project I am inheriting several forms. However when I inherit from a form and add additional subroutines and methods to my inherited form I get all sorts of problems. e.g. I sometimes get MyVarialble is not declared errors when the variable is quite clearly declared, when I change it to public and then back again to private the...
0
7915
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8204
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. ...
0
8339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7965
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...
1
5712
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3838
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
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
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.