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.Conten tType = "applicatio n/octet-stream; name=Test.eml"
Response.AddHea der("content-transfer-encoding", "binary")
Response.AddHea der("content-disposition", "attachment;fil ename=Test.eml" )
Response.Conten tEncoding = System.Text.Enc oding.GetEncodi ng(1251)
Response.Binary Write(bytes)
s.Close()
s = Nothing
Anyone got any ideas?
Stu