ASP to initiate download

  • Thread starter Karl E. Peterson
  • Start date
K

Karl E. Peterson

Hi --

Anyone know how to kick off a download (of, say, a ZIP file) with ASP? Please note,
not ASP.NET, just plain-old ASP. I've seen all the Response.WriteFile posts, but
those don't scale back. Would rather not use JavaScript, either, due to things like
the NoScript add-in for Firefox.

Thanks... Karl
 
K

Karl E. Peterson

Karl said:
Anyone know how to kick off a download (of, say, a ZIP file) with ASP? Please
note, not ASP.NET, just plain-old ASP. I've seen all the Response.WriteFile
posts, but those don't scale back. Would rather not use JavaScript, either, due
to things like the NoScript add-in for Firefox.

Figured it out. It's just a matter of a simple redirect:

<%
Dim filename ' As String
Select Case LCase(Request.QueryString("id"))
Case "file1"
filename = "../tools/file1.zip"
Case "file2"
filename = "../tools/file2.zip"
End Select
Response.Redirect filename
%>
 
K

Karl E. Peterson

Karl E. Peterson mumbled to himself:
Karl E. Peterson wondered:

Figured it out. It's just a matter of a simple redirect:

<%
Dim filename ' As String
Select Case LCase(Request.QueryString("id"))
Case "file1"
filename = "../tools/file1.zip"
Case "file2"
filename = "../tools/file2.zip"
End Select
Response.Redirect filename
%>

Okay, so this isn't ideal either. Because it sends the URL back to the browser,
which then makes a new request, right? So, I guess the goal is to slurp the bits
with FSO, then spit 'em back with Response.BinaryWrite? <grumble>
 
K

Karl E. Peterson

Karl E. Peterson throws in the towel, and rolls his own:
Karl E. Peterson mumbled to himself:

Okay, so this isn't ideal either. Because it sends the URL back to the browser,
which then makes a new request, right? So, I guess the goal is to slurp the bits
with FSO, then spit 'em back with Response.BinaryWrite? <grumble>

FSO bites. Needed a custom DLL that'd return binary data for the BinaryWrite.

D'oh!
 
S

Stefan B Rusynko

Take a look at
http://classicasp.aspfaq.com/general/how-do-i-zip/unzip-files-from-asp.html

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| Karl E. Peterson throws in the towel, and rolls his own:
| > Karl E. Peterson mumbled to himself:
| >> Karl E. Peterson wondered:
| >>> Anyone know how to kick off a download (of, say, a ZIP file) with ASP? Please
| >>> note, not ASP.NET, just plain-old ASP. I've seen all the Response.WriteFile
| >>> posts, but those don't scale back. Would rather not use JavaScript, either, due
| >>> to things like the NoScript add-in for Firefox.
| >>
| >> Figured it out. It's just a matter of a simple redirect:
| >>
| >> <%
| >> Dim filename ' As String
| >> Select Case LCase(Request.QueryString("id"))
| >> Case "file1"
| >> filename = "../tools/file1.zip"
| >> Case "file2"
| >> filename = "../tools/file2.zip"
| >> End Select
| >> Response.Redirect filename
| >> %>
| >
| > Okay, so this isn't ideal either. Because it sends the URL back to the browser,
| > which then makes a new request, right? So, I guess the goal is to slurp the bits
| > with FSO, then spit 'em back with Response.BinaryWrite? <grumble>
|
| FSO bites. Needed a custom DLL that'd return binary data for the BinaryWrite.
|
| D'oh!
| --
| .NET: It's About Trust!
| http://vfred.mvps.org
|
|
 
S

Stefan B Rusynko

It provides recommended tools to create zip files from ASP

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| Stefan B Rusynko wrote:
| > Take a look at
| > http://classicasp.aspfaq.com/general/how-do-i-zip/unzip-files-from-asp.html
|
| Okay, I give. Relevance? (Thanks, though!)
| --
| .NET: It's About Trust!
| http://vfred.mvps.org
|
|
|
| > | >| Karl E. Peterson throws in the towel, and rolls his own:
| >| > Karl E. Peterson mumbled to himself:
| >| >> Karl E. Peterson wondered:
| >| >>> Anyone know how to kick off a download (of, say, a ZIP file) with ASP?
| >Please
| >| >>> note, not ASP.NET, just plain-old ASP. I've seen all the Response.WriteFile
| >| >>> posts, but those don't scale back. Would rather not use JavaScript, either,
| >| >>> due to things like the NoScript add-in for Firefox.
| >| >>
| >| >> Figured it out. It's just a matter of a simple redirect:
| >| >>
| >| >> <%
| >| >> Dim filename ' As String
| >| >> Select Case LCase(Request.QueryString("id"))
| >| >> Case "file1"
| >| >> filename = "../tools/file1.zip"
| >| >> Case "file2"
| >| >> filename = "../tools/file2.zip"
| >| >> End Select
| >| >> Response.Redirect filename
| >| >> %>
| >| >
| >| > Okay, so this isn't ideal either. Because it sends the URL back to the
| >browser,
| >| > which then makes a new request, right? So, I guess the goal is to slurp the
| >| > bits with FSO, then spit 'em back with Response.BinaryWrite? <grumble>
| >|
| >| FSO bites. Needed a custom DLL that'd return binary data for the BinaryWrite.
| >|
| >| D'oh!
| >| --
| >| .NET: It's About Trust!
| >| http://vfred.mvps.org
|
|
|
 
K

Karl E. Peterson

Stefan said:
It provides recommended tools to create zip files from ASP

Ah, I see. The problem wasn't creating the ZIP(s). Those already exist. The
problem was initiating a binary transfer (download) of the files, which in this case
just happened to be ZIP(s).

In order to use the Response.BinaryWrite method, you need binary data to write. Not
something FSO is happy to provide, so I had to write my own DLL to do that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top