Re: password protect subdirectory and files within

From: Cowboy \(Gregory A. Beamer\) (N0SpamMPleezEgbworld@comcast.netN0SpamMPleezE)
Date: 10/28/02


From: "Cowboy \(Gregory A. Beamer\)" <N0SpamMPleezEgbworld@comcast.netN0SpamMPleezE>
Date: Mon, 28 Oct 2002 12:49:43 -0600


Using the <location> section in the .config file, you can lock down any
number of pages and create this type of access. If users have to log in to a
domain, you can also secure with NTFS permissions. You will want to control
the links, if this is the method you employ.

I have not personally tried using <location> on a non-ASPX page, but I would
imagine it would work, as there is an HTTP ASP.NET object that uses the
web.config permissions to control the pages under its control. I could be
wrong, but try experimenting.

Another method is to serve up the PDF files through code and hide where they
are located from the user. We use this method on one of our sites right now.
You have to strip all but the @ directive from the ASPX page you are using
if you want the app to serve a PDF.

You also have the option to use Server.Transfer, which hides the file from
most people. A clever hacker can get the properties for the file, but the
average Joe will just see the showPDF.aspx designation in the address bar.
If you are primarily working on keeping the average Joe out, this is much
easier than dealing with the coding necessary to serve up a different
document type through code (although that is not too many lines of code).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Author: ADO.NET and XML: ASP.NET on the Edge
****************************************************************************
****
Think outside the box!
****************************************************************************
****
"dustin" <englishman11@hotmail.com> wrote in message
news:d157b561.0210280259.6b612340@posting.google.com...
> Hi,
>
> I'm upgrading from ASP 3.0 to ASP.NET and would like to know if
> ASP.NET has introduced anything new to help protect files within a
> subdirectory to see if you are a valid user which has logged into the
> web application.
>
> Requirements.
>
> Users to browse site normally.  However, when trying to go directly to
> a file within the protected subdirectory, without having first logged
> in, get an automatic faliure response, therefore not displaying the
> file requested.
>
> e.g. URL: -- > www.mydomain.com/protectedsubdirectory/protectedFile.pdf
>
> response -->   sorry, you must be logged in first
>
> Once logged in however using a MS SQL server to check username and
> password, I would like for the members to be able to browse freely
> through the protected subdirectory.
>
> I would not only like to protect aspx file, I would really like to
> protect any files in the protected subdirectory.
>
> Is there an easy way to do this? and if not could someone point me in
> the right direction as to tutorials, URL links, or documentation on
> this subject please.
>
> thanks
>
> dustin_kovich
> (Student of Life)


Relevant Pages

  • Re: Technology vs instincts in the rise of feminism
    ... >there is no overarching and persistent 'intention' to their development ... >control more and more aspects of women's lives. ... >western societies' intentional controllerwho, once convinced, ... >> instinct in order to protect women. ...
    (soc.men)
  • Re: Technology vs instincts in the rise of feminism
    ... >>control more and more aspects of women's lives. ... >>western societies' intentional controllerwho, once convinced, ... > out of instinct to protect women. ... > instinct, exalt women above themselves. ...
    (soc.men)
  • Re: I want the macros to be locked up when cells are locked up.
    ... you need look at the EnableCancelKey property to have better control ... > Could you give me sample entries that would protect VBA code? ... >>> control button and edit the Macro. ...
    (microsoft.public.excel.programming)
  • Re: Tab key problem in a protected document containing a VB control
    ... Add any Visual Basic control anywhere in the document. ... Turn off design mode and protect the document again. ... I tried overriding the tab key behavior by creating a macro named ... Any suggestions for workarounds are also appreciated. ...
    (microsoft.public.word.vba.general)
  • Re: ActiveX checkbox resizing
    ... trying to do this using Control Toolbox controls. ... in between the parts you want to protect and not protect. ... clicking the little "lock" on the toolbar, click "Tools", "Protect ... > Suzanne, thanks your response. ...
    (microsoft.public.word.docmanagement)