Kevin Barrie

Kevin Barrie

  • NA
  • 9
  • 3.2k

Failed to load resource: net::ERR_EMPTY_RESPONSE Error

Jan 29 2020 8:24 PM
Hello
 
I am trying to Redirect to a pdf file using Reponse.Redirect(pdfurl).  The application is uses ASP.NET, C#, AJAX Toolkit.
 
This works for the majority of the pdfs the application creates, however for certain ones, the page does not get redirected and on the console I get the error - Failed to load resource: net::ERR_EMPTY_RESPONSE.
 
The only difference from the pdf's that work and the ones that don't seem to be size.  The ones that work are approx 2.5KB and the ones that don't are 4.6KB.
 
The code I use is - 
 
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment; filename=" + Path.GetFileName(theReportName) + ";");
Response.Redirect(theReportName);
         ApplicationInstance.CompleteRequest();
 
An example of the pdf url is -  "~/Secure/GraphBin/Reports/yei3k3msbctxeo3som4w0jse/297f489d-7a41-4098-883e-264b82e61d8e/Quarterly Report Q3 2019.pdf"
 
Can anyone help please?
 
 Thanks
 
Kevin 

Answers (1)