1
Answer

Display the content of .doc file

Cien S

Cien S

14y
3k
1
Hi,

Need some help with an problem that bugging me..

I have to open a .doc file at the client side when the user clicks a button.

Opening is not a problem.. I am able to do it using the following code
which is executed when the user clicks on the button

 my code:

byte[] imagecontent = (byte[])(drd[0]);
                            Response.ContentType = "application/octet-stream";
                            Response.AddHeader("Content-Disposition", "attachment;filename=" + drd.GetValue(1).ToString());
                            Context.Response.BinaryWrite(imagecontent);

The problem is that the user first sees a 'Open/ Save / Cancel' dialog box. Only when the user clicks on 'Open' does the .doc file get opened.

Am at a loss and any help will be appreciated.

Thanks


Answers (1)