Quote:
Originally posted by BScullio
Im not sure If I clicked dont prompt ever. I may have. Which means that others probably would have too. Which makes this solution unsuitable.
I have just tried it on 2 other machines with the same result.
Im researching setting the server to interpret .txt files.
Do you (or anybody) know of a better way to do it?
|
I'm assuming, since this is the ASP forum, that you can execute ASP code. The best way to FORCE them to download the file is to stream it to them through ASP:
Code:
<%
Response.Buffer = True
Response.Clear
Dim strFilePath, strFileName
Const adTypeBinary = 1
Set objStream = Server.CreateObject("ADODB.Stream")
strFilePath = Server.MapPath("/virtualpath/tofolder") & "\"
strFileName = "mytextfile.txt"
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFilePath & strFileName
Response.AddHeader "Content-Disposition", "attachment; filename=" & StrFileName
Response.Charset = "UTF-8"
Response.ContentType = "text/plain"
'Google "Mime Types" for addtional Content Type definitions
Response.BinaryWrite objStream.Read
Response.Flush
objStream.Close
Set objStream = Nothing
%>