Hi,
I have a reporting application that exports data to different format and
sends file to the browsers with the following code:
string fileName = @"" + Request.QueryString["filename"];
//fileName = Request.QueryString["filename"];
if (fileName.Length==0)
{
Response.Redirect("default.aspx", true);
return;
}
fileName = Server.MapPath(fileName);
System.IO.FileInfo TargetFile = new System.IO.FileInfo(fileName);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=BLT
report");
Response.AddHeader("Content-Length", TargetFile.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(fileName);
// stop the execution of this page
Response.Flush();
Excel format works no problem, but only PDF gives access denied. Do I need
to give special permisions to pdf files?
thank you