How to authorize download?

From: Daniel Fisher\(lennybacon\) (info_at_(removethis)lennybacon.com)
Date: 12/28/04


Date: Tue, 28 Dec 2004 21:54:08 +0100

Write the files based on a querystringvariable as binary to the response
stream (if the user is authenticated, otherwise send him some greetings with
a errormessage) - so you don't have to reconfigure IIS and nobody has knows
the path to the files.

-- 
Daniel Fisher(lennybacon)
 MCP ASP.NET C#
 Blog: http://www.lennybacon.com/
"Ben Lucas" <ben@nospam.solien.nospam.com> wrote in message 
news:x8CdnTqkJLUXtE3cRVn-qw@comcast.com...
> You could write an HttpHandler or an HttpModule to handle the security. 
> Basically your HttpHandler or HttpModule would need to perform the 
> security check and give an Access Denied message if the user does not have 
> access, or if the user does have access, set the content type and write 
> the file to the Response stream.
>
> Also, note that you will have to set up IIS so that the ASP.Net 
> application handles .doc, .ppt, and whatever other files you want to 
> provide security for.
>
> -- 
> Ben Lucas
> Lead Developer
> Solien Technology, Inc.
> www.solien.com
>
> "lenyado" <lenyado@discussions.microsoft.com> wrote in message 
> news:04C224EB-729A-41DC-819F-598FCC47C5B0@microsoft.com...
>>I am planning a website which reqires this feature: it allows registered
>> users to upload and/or download files (like *.doc, *.ppt etc.) but not
>> everyone can download every files. some files are restricted to certain 
>> users
>> only. that means only certain users can download certain files. but if 
>> the
>> URL of a certain file that needed to be protected is exposed, the
>> authorization will be in vain. any solutions?
>
> 


Relevant Pages

  • Re: Sending text stream as text file from aspx page
    ... the tags will always render. ... I have some code that I am using to build a stream (test text at this ... have this available as a download without having to write the file to ... As you can see my text appears at the top of the file, but the response ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: simple Socket Programming question.
    ... numberOfBytesRead); ... I don't have more than 1 concurrent download at a type then i don't need a ... you've read tells you that the stream has ended, ... HTTP response, then read that exact number of bytes in by looping around ...
    (microsoft.public.dotnet.framework)
  • Re: MemoryStream??
    ... All the other files download just fine. ... > then you simply need to put it into the file stream directly. ... > recommend using a buffered loop to stream the file data from the response ... >> this because the computer does not have enough memory to store the ...
    (microsoft.public.dotnet.framework)
  • Re: MemoryStream??
    ... All the other files download just fine. ... > then you simply need to put it into the file stream directly. ... > recommend using a buffered loop to stream the file data from the response ... >> this because the computer does not have enough memory to store the ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: MemoryStream??
    ... All the other files download just fine. ... > then you simply need to put it into the file stream directly. ... > recommend using a buffered loop to stream the file data from the response ... >> this because the computer does not have enough memory to store the ...
    (microsoft.public.dotnet.framework.remoting)