Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-15-2007, 04:05 PM   PM User | #1
cornholio27
New to the CF scene

 
Join Date: Mar 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
cornholio27 is an unknown quantity at this point
Unhappy Forcing download dialog box problem

Hi guys.

Having some problems in creating a force download asp. I have got the code from a common example on the net, but I just can't get it working right. The download box does pop up with the correct filename (but always shows a .rar icon). But when I download it the file is always 4kb in size and cannot be opened.

Here is my code:

<%
Response.ContentType = "application/unknown"

Response.AddHeader "Content-Disposition","attachment; filename=" & Request("FileName")

Set objStream = Server.CreateObject("ADODB.Stream")

objStream.Open

objStream.Type = 1

objStream.LoadFromFile Server.MapPath("vaggio/") & Request("FileName")

download = objStream.Read

Response.BinaryWrite download


Set objstream = Nothing
%>


and it is called by:

<a href="download.asp?FileName=bottom.jpg">bottom</a>



any help on this would be much appreciated
cornholio27 is offline   Reply With Quote
Old 03-15-2007, 05:00 PM   PM User | #2
Roelf
Senior Coder

 
Join Date: Jun 2002
Location: Zwolle, The Netherlands
Posts: 1,110
Thanks: 2
Thanked 28 Times in 28 Posts
Roelf is on a distinguished road
can you find anything useful in this thread?
Roelf is offline   Reply With Quote
Old 03-16-2007, 07:25 AM   PM User | #3
SSJ
Regular Coder

 
Join Date: Mar 2007
Posts: 230
Thanks: 0
Thanked 4 Times in 4 Posts
SSJ is an unknown quantity at this point
Quote:
Originally Posted by Roelf View Post
can you find anything useful in this thread?
Good thread
__________________
Best Joomla Design Agency India ||PSD to Joomla Template || Award Winning Web Design Company India
SSJ is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:54 PM.


Advertisement
Log in to turn off these ads.