Results 1 to 1 of 1
  1. #1
    Join Date
    Nov 2004

    Forcing a Download box in ASP

    I have a list of hyperlinks to files and would like to have the download box appear when user clicks on file links(of any type) instead of the files opening right away.
    The following code fails at the loadfile command. It gives error 500. Can someone please help?

    Thank you in advance,

    <%@ Language=VBScript %>


    Dim filePath
    Dim fileName
    Dim FStream

    'Set the file and path
    fileName = request.querystring("f")
    filePath = "" & fileName


    'Create the header information
    Response.ContentType = "application/asp-unknown"
    Response.AddHeader "content-disposition","attachment; filename=" & fileName

    'Create and configure the object
    Set FStream = Server.CreateObject("ADODB.Stream")
    FStream.Type = 1

    'Stream it to the client
    Response.BinaryWrite FStream.Read()

    Set FStream = Nothing

    'Force the end

    Last edited by Nima; 12-07-04 at 14:01.

Posting Permissions

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