>I'm creating an ASP application, and I want to be able to call a page, with parameters, and have it download a file based on the parameters passed.
>
>The problem that I have, is that I want IE/Netscape to use the correct filename when prompting to save the file.
>
>This works for downloading the file, but the browser always tries to save it with the name of the ASP page.
>
>'---------------------
>'DLTEST.ASP
>Dim fso, f1, ts, lcFile, lcData
>lcFile = "c:\excelfile.xls"
>
>Response.Buffer = TRUE
>
>'Read the file using FSO
>Set fso = CreateObject("Scripting.FileSystemObject")
>Set ts = fso.OpenTextFile(lcFile, 1)
>lcData = ts.ReadAll
>
>'Write the file
>Response.ContentType = "application/octet-stream"
>Response.BinaryWrite lcData
>
>SET ts = NOTHING
>SET FSO = NOTHING
>
>Response.end
>'------------------
>
>Any suggestions greatfully accepted.
Solved it myself.
FYI, You need to use Response.AddHeader to add a Content-Disposition header with a filename=NameToUse value.