You can also use the Stream Object to make the user download the file with a different name..... here's a sample function that will download a file called File.csv located on D:\ on your server as File.txt. You can even change the whole name:
Response.Buffer = True Response.Clear
Call ForceDownload("D:\File.csv", "File.txt")
Function ForceDownload(strPath, strfilespec)
Dim oStream
Set oStream = server.createobject("ADODB.Stream")
oStream.Open oStream.Type = 1 ' Binary oStream.LoadFromFile strPath Respon se.ContentType="application/unknown" Respon se.AddHeader "Content-Disposition","attachment; filename=" & chr(34) & strfilespec & chr(34) Respon se.BinaryWrite oStream.Read
Response.Flush oStream.Close Set oStream = Nothing End Function |