Sachin Mortale

Sachin Mortale

  • NA
  • 9
  • 2.8k

Response.AddHeader is not working in chrome,safari

Sep 25 2013 4:33 AM
Hi,
I am using following code for downloading file and after downloading file its opens my site page, but its work only in firefox browser other browser its not working.

Response.AddHeader("Refresh", "3; url=http://www.mysite.com/");
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment; filename=myfile.pdf");
Response.TransmitFile(Server.MapPath("myfile.pdf"));
Response.End();