download file

Results 1 to 2 of 2

Thread: download file

  1. #1
    Join Date
    Dec 1969

    Default download file

    I have the following asp code which i am using to download a file from server....when users submit a button from form page..but it is not working any ideas why<BR> Thanks<BR><BR>&#060;%<BR><BR>const ForReading = 1<BR>const TristateTrue = -1<BR><BR><BR><BR><BR>Dim path, mimeType<BR>path = "Toolkit_Buffer.txt"<BR>mimeType = "text/text"<BR><BR><BR>Dim objFileSystem, objFile, objStream<BR><BR><BR><BR><BR><BR> set objFileSystem = server.CreateObject("Scripting.FileSystemObject")< BR> set objFile = objFileSystem.GetFile(path)<BR> set objStream = objFile.OpenAsTextStream(ForReading, TristateTrue)<BR> <BR> Response.AddHeader "content-type", mimetype<BR> Response.AddHeader "content.length", objFile.size<BR> <BR> Response.Flush <BR> if not Response.IsClientConnected then TransferFile = Flase<BR> <BR> <BR><BR><BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: download file

    You&#039;ll need to have these additional headers:<BR>response.buffer=true<BR>Response.Conte ntType = "application/unknown"<BR>Response.CacheControl = "public"<BR>response.clear<BR><BR>as well as a Server-side component such as SA-FileUp or ASPUpload. Each has a simple method for downloading.

Posting Permissions

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