Chunked Downloads Not Working
-
I’ve noticed for a while that larger PDF file downloads on our site fail with messages like “Couldn’t download – Network issue” in the browser despite returning an HTTP 200 status code. Today I think I finally figured out the issue.
In the latest version of the plugin, in the DownloadHandler.php file, the function readfile_chunked at line 667 has three parameters: $file, $retbytes = true, and $range = false. However, it is called at line 554 in the same file with: this->readfile_chunked( $file_path, $range). The $range variable in the call is being assigned to the $retbytes parameter instead. I’ve fixed this by changing my call to: this->readfile_chunked( $file_path, true, $range) instead.
Hopefully others find this useful and maybe the plugin can be updated with the fix.
Cheers!
- The topic ‘Chunked Downloads Not Working’ is closed to new replies.