Re: Best Practices for File Access

From: Steve C. Orr [MVP, MCSD] (Steve_at_Orr.net)
Date: 03/09/04


Date: Mon, 8 Mar 2004 16:26:48 -0800

If you store your files in SQL Server then you can let it handle most of
these details.
Here's further information on that techique:
http://www.aspnetpro.com/features/2003/07/asp200307so_f/asp200307so_f.asp

Otherwise you'll probably store your restricted files in a private folder
and use Response.Writefile once you've determined the user is authorized:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebhttpresponseclasswritefiletopic.asp

To find out if a file exists you can use the System.IO.File.Exists method.
Here's more info:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemiofilememberstopic.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconreadingwritingtofiles.asp

-- 
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
<DavidElliott@nospam.BellSouth.net> wrote in message
news:300q409gesdqq651jcfehjnmd7v055paei@4ax.com...
> I am trying to do File Access for an ASP.NET project and am having some
> difficulty.  I was wondering if a document on Best Practice for File
Access exists
> somewhere.
>
> Scenerios I am looking to solve.
>
> 1) Attach an XML file to a WebControl TreeView
> 2) Anonymous access for pictures
> a) That exist in the virtual directory
> b) Exist on another disk partition
> 3) Restricted access for read/write based on person or group
>
> I am aware of authorization and authenication and know how to implement
> them.
>
> If there are some examples or documents on how to do this properly,
> (i.e. NO Hacks), I would most interested.
>
> Thanks,
> Dave
>
> DavidElliott@BellSouth.net


Relevant Pages

  • Re: Best Practices for File Access
    ... Here's further information on that techique: ... Otherwise you'll probably store your restricted files in a private folder ... > I am aware of authorization and authenication and know how to implement ...
    (microsoft.public.dotnet.framework.aspnet)
  • Authorization Application Block/ COM object with CLSID exception
    ... I'm using the authorization application block, with an active directory ... i've specified my store location as following: ...
    (microsoft.public.dotnet.security)
  • Re: Roles - Access Rule Storage
    ... You might also want to look at the Authorization Manager API if you ... Joe Kaplan-MS MVP Directory Services Programming ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ... exact same thing in your module, but store the authorization policy in the ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • AzMan & W2k3 SP1 problem...
    ... I have a xml based Authorization ... abc.xml store either by speciying the path ... But, after installing SP1, the azman.msc behavior changes. ...
    (microsoft.public.windows.server.security)