...

View Full Version : Forcing download dialog box problem



cornholio27
03-15-2007, 04:05 PM
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

Roelf
03-15-2007, 05:00 PM
can you find anything useful in this (http://www.codingforums.com/showthread.php?t=70889) thread?

SSJ
03-16-2007, 07:25 AM
can you find anything useful in this (http://www.codingforums.com/showthread.php?t=70889) thread?
Good thread



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum