WordPress.org

WordPress MU

Opened 7 years ago

Closed 7 years ago

#473 closed defect (fixed)

Large file downloads fail when chunked encoding is enabled

Reported by: dsilverman Owned by: somebody
Milestone: Priority: normal
Severity: normal Version:
Component: component1 Keywords:
Cc:

Description

Users were reporting that mp3 files would download only the first several seconds in the browser rather than the complete file. I noticed that the server was sending the data (via the wp-content/blogs.php file) as chunked encoding, but was not passing a content-length header. After the first chunk, the file stopped downloading. I added a <code>@header( 'Content-Length: ' . filesize($file) );</code> into the blogs.php file and the problem is solved, although headers now report that chunked encoding is no longer enabled.

Attachments (1)

clean_and_fix_wp-content_blogs.patch (4.6 KB) - added by momo360modena 7 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 momo360modena7 years ago

The fix is only added ?

@header( 'Content-Length: ' . filesize($file) );

See patch !

comment:2 donncha7 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Applied in [1128], I didn't apply all the cleanup code though.

comment:3 momo360modena7 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Why ?

header("HTTP/1.1 404 Not Found");

Perhaps server can't support HTTP/1.1, and only HTTP/1.0
The function status_header() support this situation ;)

comment:4 donncha7 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

That's a good point, although your patch used wp_die() for the 404's. I really hope there aren't any HTTP/1.0 browsers still around! Even scripts can use curl or some half decent library!

Check [1129] for the latest change. Thanks!

Note: See TracTickets for help on using tickets.