ASP.NET - ERR_EMPTY_RESPONSE / Connection was reset / page cannot be displayed

I get an error when I click on the PDF link generated by the web service. I do not know exactly how the web service creates a file other than that I pass the output path as a parameter:

Dim strPDF As String = Server.MapPath("~") & "\PDFs\" obj.callService(strPDF) 

I would like to provide the user with a clickable link to the PDF. I initially received an error when calling a web service that said Access to the path is denied. After you opened Google, I read to add Full Control permission to the NETWORK USER folder. I did this and now the web service creates the PDF file just fine.

When I create a link to a file and click on it in a browser, I get an error message.

Chrome:

ERR_EMPTY_RESPONSE

Firefox:

The connection was reset

IE:

This page is not displayed.

Enabling the error I received in Chrome leads me to a million and one suggestions about increasing the length of the request timeout due to processing large files, but not one of the PDF files I tried to create and had access was more than 175 KB, and most were around 65KB. In addition, I immediately receive an error message, making me think that it is not even trying to service the file.

Can someone help me figure out what I'm doing wrong?

EDIT: It's also worth noting that everything works fine locally. The error started when I clicked everything on the server.

EDIT2: I added the .tif image file in the same folder to find out what will happen, and when I try to access the file in the browser, it will just download the file. It does not display it in a browser, as in PDF format, but it is downloaded to the My Downloads folder. Does this mean that something is wrong with the PDF? Or does this mean that the problem displays content in the browser but does not load onto the computer?

+5
source share
1 answer

Good grief ... So, after ANY curse and help from the employee, I found a problem.

There was an IIS setting that caused something crazy about how the PDF files were handled for all of my websites.

To fix this (for IIS 6):

  • I opened IIS by right-clicking the "Sites" folder and the selected properties
  • On the "Home Directory" tab, I clicked "Configuration" in the "Application Settings" section.
  • On the Mapping tab, I found .pdf in the list of file extensions and clicked Delete.

He, for some reason, returned the .NET platform used on another website from 4.0 to 1.1, but as soon as I returned it, everything was fine.

If someone knows what these settings are for, and you have a good theory about what could happen in my situation, I would like to hear that! :)

+1
source

Source: https://habr.com/ru/post/1237605/


All Articles