P
Paul
This is not a question,
More a heads up in case anyone else gets this problem.
We have an HTTP Handler that spits out PDF files.
During development we chose to use the .ashx file to provide the
mapping ( saving us registering on each machine etc )
However, this produced unexpected problems with IE6 refusing to render
the PDF file.
The important point here is that as a standalone Handler it works as
intended.
The code in a standard page even works.
But put it in an ashx file and for some reason the browser does not
receive the header info.
It was only IE6 that caused this problem.
Hope this save people time.
Our code for those interested
......
if (File.Exists(_sBillPdfFilePath) && _bError ==
false)
{
//Response.Write("<pre>");
//Response.Write(_sFopResult);
//Response.Write("</pre>");
try
{
string sFile = "filename=" + "billData" +
".pdf";
Response.ContentType = "application/pdf";
Response.AppendHeader("content-disposition",
sFile);
Response.TransmitFile(_sBillPdfFilePath);
}
catch (Exception e)
{
Trace.Write("Could not write PDF to Response
object.");
Trace.Write(e.Message);
Trace.Write(e.Source);
}
}
else
{
Response.Write("<pre>");
Response.Write("The printed bill could not be
generated - please try again later.");
if (util.getApplicationContext().devMode)
{
Response.Write(_sFopResult);
}
Response.Write("</pre>");
}
More a heads up in case anyone else gets this problem.
We have an HTTP Handler that spits out PDF files.
During development we chose to use the .ashx file to provide the
mapping ( saving us registering on each machine etc )
However, this produced unexpected problems with IE6 refusing to render
the PDF file.
The important point here is that as a standalone Handler it works as
intended.
The code in a standard page even works.
But put it in an ashx file and for some reason the browser does not
receive the header info.
It was only IE6 that caused this problem.
Hope this save people time.
Our code for those interested
......
if (File.Exists(_sBillPdfFilePath) && _bError ==
false)
{
//Response.Write("<pre>");
//Response.Write(_sFopResult);
//Response.Write("</pre>");
try
{
string sFile = "filename=" + "billData" +
".pdf";
Response.ContentType = "application/pdf";
Response.AppendHeader("content-disposition",
sFile);
Response.TransmitFile(_sBillPdfFilePath);
}
catch (Exception e)
{
Trace.Write("Could not write PDF to Response
object.");
Trace.Write(e.Message);
Trace.Write(e.Source);
}
}
else
{
Response.Write("<pre>");
Response.Write("The printed bill could not be
generated - please try again later.");
if (util.getApplicationContext().devMode)
{
Response.Write(_sFopResult);
}
Response.Write("</pre>");
}