Guest User

Untitled

a guest
Nov 20th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. using (MemoryStream ms = new MemoryStream())
  2. {
  3. doc.SaveAs(ms);
  4.  
  5. Response.Clear();
  6. Response.AddHeader("Content-Disposition", string.Format("attachment; filename={0}", fileName));
  7. Response.ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
  8. ms.WriteTo(Response.OutputStream);
  9. Response.End();
  10. }
Add Comment
Please, Sign In to add comment