WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-08-2006, 05:58 PM
WebProWorld New Member
 

Join Date: Jun 2006
Posts: 1
jtholmes RepRank 0
Default I can't get ASP to force a download and redirect

I have code that works for forcing a download but I also need to redirect to another page. However I can't get both to work together. Below is the code I have to force the download but response.redirect nor server.transfer or server.execute work along with this code.

<%
Response.Buffer=true
On Error Resume Next
'Create a stream object
Dim tfm_downloadStream
Set tfm_downloadStream = Server.CreateObject("ADODB.Stream")
tfm_downloadStream.Type = 1
tfm_downloadStream.Open
tfm_downloadStream.LoadFromFile Server.Mappath("lakelogo_mac.eps")
If Err.number = 0 Then
Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AddHeader "Content-Disposition", "attachment; filename=lakelogo_mac.eps"
Response.AddHeader "Content-Transfer-Encoding","binary"
Response.BinaryWrite tfm_downloadStream.Read
tfm_downloadStream.Close
Set tfm_downloadStream = Nothing
Else
tfm_downloadStream.Close
Set tfm_downloadStream = Nothing
Response.Redirect("../index.htm")
End If
'Basic-UltraDev BUD_ForceDownload server behavior
%>
Reply With Quote
  #2 (permalink)  
Old 06-27-2006, 05:34 PM
WebProWorld Member
 

Join Date: Sep 2003
Location: San Antonio, Texas
Posts: 40
theoart RepRank 0
Default

How about redirecting first and then force the download on the redirect page...
__________________
J. "theo" Theopistos

FinerWorks.com
http://finerworks.com
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0