Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. HttpContext.Current.Response.Clear();
  2. HttpContext.Current.Response.ClearContent();
  3. HttpContext.Current.Response.ClearHeaders();
  4. HttpContext.Current.Response.Buffer = true;
  5. HttpContext.Current.Response.Charset = "";
  6. HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
  7. HttpContext.Current.Response.ContentType = "application/octet-stream";
  8. HttpContext.Current.Response.AddHeader("Content-Length", myData.Length.ToString());
  9. HttpContext.Current.Response.AddHeader("Content-Disposition", String.Format("attachment; filename={0}", Path.GetFileName(file)));
  10. HttpContext.Current.Response.BinaryWrite(myData);
  11. //ArquivoPdfProcessado = myData;
  12. HttpContext.Current.Response.Flush();
  13. HttpContext.Current.ApplicationInstance.CompleteRequest();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement