Dim fs As FileStream
Dim strContentType As String
Dim strPath = "C:\My External\File Path\"
Dim strFileName As String = "TomsTest.txt"
fs = File.Open(strPath & strFileName, FileMode.Open)
Dim bytBytes(fs.Length) As Byte
fs.Read(bytBytes, 0, fs.Length)
fs.Close()
Response.AddHeader("Content-disposition", _
"attachment; filename=" & strFileName)
Response.ContentType = "application/octet-stream"
Response.BinaryWrite(bytBytes)
Response.End()
If I run this on an XP and the user has Automatic downloads of files
disabled, the user will get a blank page with all the text displaying on it.
If it is enabled, I get the Save As prompt and allows the user to save the
file.
This can be confusing to the user. Is there a way for me to know if the
user will have a problem with the download?
This is not an automatic download, the user is actually pushing a button
saying he wants to download the file.
Thanks,
Tom
--
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.
"tshad" <tschei...@ftsolutions.com> wrote in message
news:uXK8u8lQ...@tk2msftngp13.phx.gbl...