Connecting Tech Pros Worldwide Help | Site Map

how to setup a download page

Jeff Jarrell
Guest
 
Posts: n/a
#1: Nov 19 '05
I want to setup a downloads page on my site. Most of the time they are zip
files but they are also MSI files. Things work ok if I simply put an <a>
element referencing the file to download but I'd like a little more smarts
to it. I'd like to know how many times the file was downloaded along with
the referrer information. I'd also like to hide the actual physical file
location.

So I send it to another URL to record the download but then how do I
initiate the download (from a push point of view).

thanks.


Kevin Frey
Guest
 
Posts: n/a
#2: Nov 19 '05

re: how to setup a download page


Try writing a custom HttpHandler. The parameters will usually be passed via
query strings. The custom handler then generates the appropriate ContentType
for the output, and generates the output data (eg. by reading the
appropriate file).

I am using this technique not for a file download but for a similar
purpose - a report generator page that contructs a report based on
parameters supplied to it, then supplies the report back as either HTML
output or PDF output.

You can also "get away with" using a standard ASP.NET form and using
Response.Write/Response.WriteFile and Response.End, but it is not a clean
solution.

"Jeff Jarrell" <jjarrel_NOSPAM@yahoo.com> wrote in message
news:%232ArjXD2FHA.3660@TK2MSFTNGP15.phx.gbl...[color=blue]
>I want to setup a downloads page on my site. Most of the time they are zip
>files but they are also MSI files. Things work ok if I simply put an <a>
>element referencing the file to download but I'd like a little more smarts
>to it. I'd like to know how many times the file was downloaded along with
>the referrer information. I'd also like to hide the actual physical file
>location.
>
> So I send it to another URL to record the download but then how do I
> initiate the download (from a push point of view).
>
> thanks.
>[/color]


Steve C. Orr [MVP, MCSD]
Guest
 
Posts: n/a
#3: Nov 19 '05

re: how to setup a download page


I'd suggest creating a download page that manages such files. It might use
Response.WriteFile for example:

Response.Clear()
Response.ContentType = Whatever
Response.Writefile("c:\whatever.zip")
Response.AddHeader("Content-Disposition", _
"attachment;filename=whatever.zip")
Response.End()

Or you might choose to store your files in SQL Server, such as in this
example that explains all about uploading and downloading files:
http://SteveOrr.net/articles/EasyUploads.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"Jeff Jarrell" <jjarrel_NOSPAM@yahoo.com> wrote in message
news:%232ArjXD2FHA.3660@TK2MSFTNGP15.phx.gbl...[color=blue]
>I want to setup a downloads page on my site. Most of the time they are zip
>files but they are also MSI files. Things work ok if I simply put an <a>
>element referencing the file to download but I'd like a little more smarts
>to it. I'd like to know how many times the file was downloaded along with
>the referrer information. I'd also like to hide the actual physical file
>location.
>
> So I send it to another URL to record the download but then how do I
> initiate the download (from a push point of view).
>
> thanks.
>[/color]


Jeff Jarrell
Guest
 
Posts: n/a
#4: Nov 19 '05

re: how to setup a download page


excellent. thanks.

"Steve C. Orr [MVP, MCSD]" <Steve@Orr.net> wrote in message
news:u5n2B3F2FHA.1132@TK2MSFTNGP10.phx.gbl...[color=blue]
> I'd suggest creating a download page that manages such files. It might
> use Response.WriteFile for example:
>
> Response.Clear()
> Response.ContentType = Whatever
> Response.Writefile("c:\whatever.zip")
> Response.AddHeader("Content-Disposition", _
> "attachment;filename=whatever.zip")
> Response.End()
>
> Or you might choose to store your files in SQL Server, such as in this
> example that explains all about uploading and downloading files:
> http://SteveOrr.net/articles/EasyUploads.aspx
>
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
>
> "Jeff Jarrell" <jjarrel_NOSPAM@yahoo.com> wrote in message
> news:%232ArjXD2FHA.3660@TK2MSFTNGP15.phx.gbl...[color=green]
>>I want to setup a downloads page on my site. Most of the time they are zip
>>files but they are also MSI files. Things work ok if I simply put an <a>
>>element referencing the file to download but I'd like a little more smarts
>>to it. I'd like to know how many times the file was downloaded along with
>>the referrer information. I'd also like to hide the actual physical file
>>location.
>>
>> So I send it to another URL to record the download but then how do I
>> initiate the download (from a push point of view).
>>
>> thanks.
>>[/color]
>
>[/color]


Closed Thread