Zip files are not having Content-Length header set while downloading

For my site: quicklens.netlify.app, the Zip file download is not having the Content-Length header set, because of which I am not able to show a progress indicator on my client.

How can I enable this header on the zip file? This can be seen when clicking on the “Download Trial” link on the website. The Chrome DevTools don’t show the content-length header.

The file in consideration: https://quicklens.app/releases/QuickLens.zip

Hi, @pavanpodila. The header is being sent when I test:

$ curl -svo /dev/null https://quicklens.netlify.app/releases/QuickLens.zip  2>&1 | egrep '^< '
< HTTP/2 200
< accept-ranges: bytes
< cache-control: public, max-age=0, must-revalidate
< content-length: 9058932
< content-type: application/zip
< date: Tue, 15 Dec 2020 08:47:52 GMT
< etag: "4142d68d525b60d86aaf5910856c4512-ssl"
< strict-transport-security: max-age=31536000; includeSubDomains; preload
< age: 0
< server: Netlify
< x-nf-request-id: 685224e6-73fc-4a70-84e5-1d8c0c2635e1-2455924
<

I don’t believe the download appears in devtools at all. If it did appear there, you will see the header though. Here is a StackOverflow post about how to see those requests in the Network tab:

If there are other questions or concerns, please let us know.

Yes in curl it is showing through. However, when you download in Chrome or other clients, it is not present and this results in an experience where you don’t see any progress bar. You can try it in Chrome by clicking on the download button and you will see there is no indication of the total size.

1 Like

Thanks for the post and also for the solution