E
Eric Sabine
I have a web site where the user is able to download a file. I can't use an
anchor tag because I don't want the user to see where the filename is coming
from. Below is the code in which the user clicks to get the file. I could
swear this used to work but it definitely doesn't now. Each time at the
Response.End() method, I get a System.Threading.ThreadAbortException. I'm
not really sure why it is happening. Any clues?
Eric
Dim fStream As New System.IO.FileStream("c:\test.htm", IO.FileMode.Open,
IO.FileAccess.Read, IO.FileShare.Read)
Dim b(CType(fStream.Length, Int32)) As Byte
Response.Clear()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/unknown"
Response.AddHeader("Content-Disposition", "attachment;filename=c:\test.htm")
fStream.Read(b, 0, CType(fStream.Length, Int32))
Response.BinaryWrite(b)
Response.End()
fStream.Close()
fStream = Nothing
anchor tag because I don't want the user to see where the filename is coming
from. Below is the code in which the user clicks to get the file. I could
swear this used to work but it definitely doesn't now. Each time at the
Response.End() method, I get a System.Threading.ThreadAbortException. I'm
not really sure why it is happening. Any clues?
Eric
Dim fStream As New System.IO.FileStream("c:\test.htm", IO.FileMode.Open,
IO.FileAccess.Read, IO.FileShare.Read)
Dim b(CType(fStream.Length, Int32)) As Byte
Response.Clear()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/unknown"
Response.AddHeader("Content-Disposition", "attachment;filename=c:\test.htm")
fStream.Read(b, 0, CType(fStream.Length, Int32))
Response.BinaryWrite(b)
Response.End()
fStream.Close()
fStream = Nothing