Re: Protect file with different extension from .aspx

From: gabe garza (gbgarza_at_yahoo.com)
Date: 03/29/05


Date: Tue, 29 Mar 2005 02:53:35 GMT

Create an ASPX page that'll download the file to the user.
Example. http://www.servername.com/getfile.aspx?filename=3928393293

Now you can still use form authentication.

Make sure in getfile.aspx to set your Content-Type and Content-Disposition
properly.

I did a similar thing for a client that wanted images sent from an AS/400
computer to be displayed in a client browser, but only if a valid user was
logged into the system.
I also made sure that 3928393293 was only valid for the user that requested
the image and that 3928393293 could only be used once. Some users bookmarked
the URL but the client didn't want that.

"Alessandro Zucchi" <AlessandroZucchi@discussions.microsoft.com> wrote in
message news:396D536D-13DA-40A2-93DD-F26DE9C5B795@microsoft.com...
> Hi,
> I'm developing an asp.net application. I'm using form authentication.
> All runs with page aspx, but when I try to connect to a protected file
> diverse to an aspx (such as a PDF file) and I'm not authenticated , the
> application download the file instead of redirect to the predefined login
> page.
> Anyone can help me ?
>
> Best regards
> alex
>
>



Relevant Pages

  • Re: IIS 6 Windows 2003 SP1 RC 1289 Download bug
    ... ASPX works fine ... I noticed with compression on you could not type the xp sp2 exe link ... Now i can work on the other bugs in sp1 like the delete / rename bug, ... Just encase anyone reading this wants to know the aspx code to download a ...
    (microsoft.public.inetserver.iis)
  • Re: IIS 6 Windows 2003 SP1 RC 1289 Download bug
    ... What matters is if you have a ScriptMap ... normally a directly static file download UNLESS you have a Scriptmap of .exe ... Of course, files sent via ASPX ... Same static/dynamic download with compression turned off - successful ...
    (microsoft.public.inetserver.iis)
  • Re: IIS 6 Windows 2003 SP1 RC 1289 Download bug
    ... your download is not exactly "direct". ... A "direct" download would be something sent by the IIS static file handler ... the response is subject static and dynamic compression. ... it looks like your ASPX page is causing the problem. ...
    (microsoft.public.inetserver.iis)
  • download text/plain file without .txt extension
    ... download. ... Content-Type: text/plain ... If I access this aspx page with IE, it prompts me if I want to open or save ... the default filename is indeed myfile.lic. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to track download file from website?
    ... I want to track how many times visitor download file from my website, ... for example, when visitor click on a download link, a ASPX page will be ...
    (microsoft.public.dotnet.framework.aspnet)