S
Stu
Hi,
I need to push a .eml file (MS email pickup format) to the browser when the
user clicks on a button. The file is outside of the web space so I used this
method (which worked with word docs). This nearly works....but the email
file has the web page contents tagged on the end of it. It looks like the
Response.Clear() is not working.
'load file in to byte array
Dim s As New FileStream("c:\Test.eml", FileMode.Open)
Dim bytes() As Byte
ReDim bytes(s.Length)
s.Read(bytes, 0, s.Length)
'output file to the browser
Response.Clear()
Response.ContentType = "application/octet-stream; name=Test.eml"
Response.AddHeader("content-transfer-encoding", "binary")
Response.AddHeader("content-disposition", "attachment;filename=Test.eml")
Response.ContentEncoding = System.Text.Encoding.GetEncoding(1251)
Response.BinaryWrite(bytes)
s.Close()
s = Nothing
Anyone got any ideas?
Stu
I need to push a .eml file (MS email pickup format) to the browser when the
user clicks on a button. The file is outside of the web space so I used this
method (which worked with word docs). This nearly works....but the email
file has the web page contents tagged on the end of it. It looks like the
Response.Clear() is not working.
'load file in to byte array
Dim s As New FileStream("c:\Test.eml", FileMode.Open)
Dim bytes() As Byte
ReDim bytes(s.Length)
s.Read(bytes, 0, s.Length)
'output file to the browser
Response.Clear()
Response.ContentType = "application/octet-stream; name=Test.eml"
Response.AddHeader("content-transfer-encoding", "binary")
Response.AddHeader("content-disposition", "attachment;filename=Test.eml")
Response.ContentEncoding = System.Text.Encoding.GetEncoding(1251)
Response.BinaryWrite(bytes)
s.Close()
s = Nothing
Anyone got any ideas?
Stu