S
Stu
Hi,
I have a Word document that is stored outside of the virtual server and I
need to send it to the browser. I have tried using the code below (which
seemed a little too simplistic!). The browser pops open a dialogue asking to
save a word doc but the doc is empty.
Dim f As File
f.Open("c:\test.doc", FileMode.Open)
'output file to the browser
Response.Clear()
Response.ContentType = "application/octet-stream; name=test.doc"
Response.AddHeader("content-transfer-encoding", "binary")
Response.AddHeader("content-disposition",
"attachment;filename=test.doc")
Response.ContentEncoding = System.Text.Encoding.GetEncoding(1251)
Response.Write(f)
f.Delete("c:\test.doc")
How to I route the document to the browser properly?
Thanks in advance,
Stuart
I have a Word document that is stored outside of the virtual server and I
need to send it to the browser. I have tried using the code below (which
seemed a little too simplistic!). The browser pops open a dialogue asking to
save a word doc but the doc is empty.
Dim f As File
f.Open("c:\test.doc", FileMode.Open)
'output file to the browser
Response.Clear()
Response.ContentType = "application/octet-stream; name=test.doc"
Response.AddHeader("content-transfer-encoding", "binary")
Response.AddHeader("content-disposition",
"attachment;filename=test.doc")
Response.ContentEncoding = System.Text.Encoding.GetEncoding(1251)
Response.Write(f)
f.Delete("c:\test.doc")
How to I route the document to the browser properly?
Thanks in advance,
Stuart