Firefox can't download private PDFs I have an issue with FireFox where it can't download generated private file PDFs, yet Chrome has no such issue. 

We populate PDF files with TCPDF and they get moved and copied into a few different directories. But ultimately, they're in directories in the private files directory behind the document root, with Drupal configured to look at this directory. 

If I move any of these PDFs into the root of the site and access them directly with the URL, it works fine, but I wouldn't rule out the PDFs being corrupted in some small way. I've looked at the response headers when the file's downloading and all is in order, until I get this NS_ERROR_NET_PARTIAL_TRANSFER message and it fails.

I've run with xdebug enabled and stepped through hook functions of hook_file_download and the headers generated there all seem ok too.

Other private PDFs that aren't generated can be downloaded no problem.

I'm really running out of ideas of what it could be regarding FireFox and the private files system.
Hudri's comment ultimately led me to the answer, so huge thanks!

The real issue is the mismatch between the file's real size on the server and the size Drupal stores in the file_managed table, filesize column. Firefox will only download files that have matching values for the HTTP response's Content-Length header and the real length of the file sent to the browser. As to why the value's greater than the real one I'm still finding the answer to.