Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HttpContext.Current.Response.Buffer = false;
- HttpContext.Current.Response.ClearContent();
- HttpContext.Current.Response.ClearHeaders();
- HttpContext.Current.Response.AddHeader("Content-disposition", "attachment; filename=filename.exe");
- HttpContext.Current.Response.AddHeader("Content-length", contentLength);
- HttpContext.Current.Response.AddHeader("Content-Transfer-Encoding", "binary");
- HttpContext.Current.Response.ContentType = "application/octet-stream";
- HttpContext.Current.Response.TransmitFile(filePath);
Add Comment
Please, Sign In to add comment