Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    can you find anything useful in this thread?
    I am the luckiest man in the world

  • #3
    SSJ
    SSJ is offline
    Regular Coder
    Join Date
    Mar 2007
    Posts
    230
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Quote Originally Posted by Roelf View Post
    can you find anything useful in this thread?
    Good thread


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •