Du kan använda content-disposition.
I ASP kan detta göras såhär:
%
sFile = request.querystring("file")
sPath = "C:\Inetpub\Files" & sFile
sName = request.querystring("name")
ContentType = "application/x-msdownload"
Response.Buffer = True
Const adTypeBinary = 1
Response.Clear
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile sPath
ContentType = "application/octet-stream"
Response.AddHeader "Content-Disposition", "attachment; filename=""" & sName & """"
Response.Charset = "UTF-8"
Response.ContentType = ContentType
Response.BinaryWrite objStream.Read
Response.Flush
objStream.Close
Set objStream = Nothing
%>
Filen får ej ha några som helst tecken innan eller efter ASP-taggarna.
