javascript - Chrome Network Error - Downloading PDF - Stack Overflow

In our application, we have a users downloading PDF through a AJAX call -- basically we have a table li

In our application, we have a users downloading PDF through a AJAX call -- basically we have a table listing a lot of PDF files and when the user clicks on a filename, an AJAX call is made to a Servlet which serves the file as reponse.

The Content-Length is set for the response along with other required params (Content-Disposition, Content-Type etc). We have observed that for a specific set of users, the download fails with a Network Error. The download is initially initiated and begins but after some time the download just stops processing and this error is thrown. This has been the behavior with both IE and Chrome.

Initially, the content-length was not provided and hence defaulted to chunked transfer but this has been changed now. Even with chunked transfer we did have the same issue.

We have run through the steps provided in Chrome documentation (clearing cookies etc) but there has been no respite. We did run through the net-exports feature in Chrome and they have the following as the last few lines as -

t=237104 [st=161960]  DOWNLOAD_ITEM_INTERRUPTED
                      --> bytes_so_far = "0"
                      --> interrupt_reason = "NETWORK_FAILED"
t=237104 [st=161960] -DOWNLOAD_ITEM_ACTIVE

The users who are unable to download are able to download PDF from other sites. If we host a static PDF in our site, the users are able to access it as well.

Any pointers on what would need to be our next lookout?

(The users connect to a web server Apache HTTPD)

Thanks, Aravind

In our application, we have a users downloading PDF through a AJAX call -- basically we have a table listing a lot of PDF files and when the user clicks on a filename, an AJAX call is made to a Servlet which serves the file as reponse.

The Content-Length is set for the response along with other required params (Content-Disposition, Content-Type etc). We have observed that for a specific set of users, the download fails with a Network Error. The download is initially initiated and begins but after some time the download just stops processing and this error is thrown. This has been the behavior with both IE and Chrome.

Initially, the content-length was not provided and hence defaulted to chunked transfer but this has been changed now. Even with chunked transfer we did have the same issue.

We have run through the steps provided in Chrome documentation (clearing cookies etc) but there has been no respite. We did run through the net-exports feature in Chrome and they have the following as the last few lines as -

t=237104 [st=161960]  DOWNLOAD_ITEM_INTERRUPTED
                      --> bytes_so_far = "0"
                      --> interrupt_reason = "NETWORK_FAILED"
t=237104 [st=161960] -DOWNLOAD_ITEM_ACTIVE

The users who are unable to download are able to download PDF from other sites. If we host a static PDF in our site, the users are able to access it as well.

Any pointers on what would need to be our next lookout?

(The users connect to a web server Apache HTTPD)

Thanks, Aravind

Share Improve this question asked Jul 18, 2017 at 4:50 AravindAravind 3413 silver badges14 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 3

Change PDF MIME Type in Web Server or Response Headers from

application/pdf
to
application/octet-stream

This problem is when is enabled gzip pression and/or HTTP/2

Enable http/2 for SSL connections is a hugely valuable performance setting. However http2 expects the reported size to match what the webserver reports for streamed content.

The problem occurs in Cloudflare to.

I had the Network Error issue while downloading the PDF files from Jasper. I followed the below steps to fix the downloading issue with the Chrome.

  1. Enter the chrome://settings/content/pdfDocuments?search=pdf into the address bar of the Chrome.
  2. Turn ON the option "Download PDF files instead of automatically opening them in Chrome"

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744050653a4550012.html

相关推荐

  • javascript - Chrome Network Error - Downloading PDF - Stack Overflow

    In our application, we have a users downloading PDF through a AJAX call -- basically we have a table li

    9天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信