I am converting and saving a word document to SQL Server database as varbinary. I can save the data. I want to display the uploaded Word document back to the user just like how a resume looks in Word, as if the actual Word document was embedded in the web page itself.
I have the below code, which is downloading the saved Word document as a Word file. Please tell me which is the best control to display the word document also inside the browser.
byte[] fileContent = new byte[fuResume.PostedFile.ContentLength];
fuResume.PostedFile.InputStream.Read(fileContent, 0, fuResume.PostedFile.ContentLength);
//lblAppliedMessage.Text = ByteArrayToString(fileContent);
//lblAppliedMessage.Text = BitConverter.ToString(fileContent).Replace("-", string.Empty);
byte[] btYourDoc;
btYourDoc = fileContent;
Response.ContentType = "application/ms-word";
Response.AddHeader("Content-Disposition",
"inline;filename=yourfilename.doc");
Response.BinaryWrite(btYourDoc);
Response.End();