manikanta jaladi

manikanta jaladi

  • NA
  • 70
  • 17.1k

open a document in browser

Jun 21 2016 8:46 AM
string filename = "1.docx";
string filepath= @"......\1.docx";
Response.Clear();
Response.AddHeader("content-disposition","attachment;filename=" + filename);
Response.ContentType = "application/force-download";
Response.WriteFile(filepath);
Response.Flush();
Response.End();
 I used this code for opening the document in page load event but it's not showing rather than downloading i want a preview of the document please help me

Answers (2)