Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- System.IO.File.WriteAllBytes(@"C:UsersPersonDownloadsresults.pdf", bytes)
- byte[] bytes = ms.ToArray();
- HttpResponse response = HttpContext.Current.Response;
- response.Clear();
- response.Buffer = true;
- response.AddHeader("Accept-Header", bytes.Length.ToString());
- response.AddHeader("Content-Length", bytes.Length.ToString());
- response.AddHeader("Content-Disposition", "attachment;filename=Results.pdf");
- response.AddHeader("Content-Description", "File Download");
- response.ContentType = "application/octet-stream";
- response.OutputStream.Write(bytes, 0, onvert.ToInt32(bytes.Length));
- //I've tried using this as well
- //response.BinaryWrite(bytes);
- response.Flush();
- response.End();
Add Comment
Please, Sign In to add comment