I wrote the following code in the page load event
Expand|Select|Wrap|Line Numbers
- string path = clientServerXRef1.GetDownloadpath(company.ToUpper());
- System.IO.FileStream fs = null;
- fs = System.IO.File.Open(path + company.ToUpper() + "_" + projectID + ".mpp", System.IO.FileMode.Open);
- byte[] btFile = new byte[fs.Length];
- fs.Read(btFile, 0, Convert.ToInt32(fs.Length));
- fs.Close();
- Response.AddHeader("Content-disposition", "attachment; filename=" + projectID + ".mpp");
- Response.ContentType = "application/octet-stream";
- Response.BinaryWrite(btFile);
Here it what happens
When the file downloads, it is getting blocked by the popup blocker. When i click and allow download, it reloads the page, hence it is showing the message for the second download rather than showing the first one.
Kindly let me know the solution
Regards
cmrhema