{"issue":{"state":"open","created_at":"2011-11-29T10:06:01Z","updated_at":"2011-11-29T10:06:03Z","user":{"gravatar_id":"9994df352157ae1b778b792744bdbf05","id":1073273,"url":"https://api.github.com/users/aschempp","avatar_url":"https://secure.gravatar.com/avatar/9994df352157ae1b778b792744bdbf05?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"aschempp"},"comments":2,"body":"Apparently, the sendFileToBrowser() method does not work when an output buffer is active. The file is truncated after a few bytes (probably the buffer limit) and therefore corrupted.\n\nI was able to solve this problem by calling ob_get_clean() before using sendFileToBrowser(). However, I think this could be handled directly in the Controller function to make it more reliable for developers. By adding a routine like this inside the function, the problem can be solved:\n\n```\nwhile( ob_get_clean() !== false ) {}\n```\n\n[Download the attachments](http://www.contao.org/tl_files/tickets/2678.zip \"Download the attachments of this ticket\")\nRelated issues: #2804\n\n--- _Originally created on November 17th, 2010, at 09:56am (ID 2678)_","assignee":{"gravatar_id":"87d2e5aefadcb310f9155df28c2b3582","id":1192057,"url":"https://api.github.com/users/leofeyer","avatar_url":"https://secure.gravatar.com/avatar/87d2e5aefadcb310f9155df28c2b3582?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"leofeyer"},"id":2382451,"number":2678,"labels":[{"name":"Defect","color":"bd2c00","url":"https://api.github.com/repos/contao/test/labels/Defect"},{"name":"framework","color":"e6e6e6","url":"https://api.github.com/repos/contao/test/labels/framework"}],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"Controller::sendFileToBrowser and the output buffer","closed_at":null,"html_url":"https://github.com/contao/test/issues/2678","url":"https://api.github.com/repos/contao/test/issues/2678","milestone":{"state":"open","created_at":"2011-11-29T05:27:05Z","due_on":null,"closed_issues":50,"creator":{"gravatar_id":"87d2e5aefadcb310f9155df28c2b3582","id":1192057,"url":"https://api.github.com/users/leofeyer","avatar_url":"https://secure.gravatar.com/avatar/87d2e5aefadcb310f9155df28c2b3582?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"leofeyer"},"number":32,"description":"Contao 2.10.0 (minor release)","title":"2.10.0","url":"https://api.github.com/repos/contao/test/milestones/32","open_issues":1}},"action":"created","comment":{"created_at":"2011-11-29T10:06:03Z","updated_at":"2011-11-29T10:06:03Z","user":{"gravatar_id":"9994df352157ae1b778b792744bdbf05","id":1073273,"url":"https://api.github.com/users/aschempp","avatar_url":"https://secure.gravatar.com/avatar/9994df352157ae1b778b792744bdbf05?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"aschempp"},"body":"Here's a patch file for what I mean.\n\n--- _Originally created on November 22nd, 2010, at 11:38am_","id":2926620,"url":"https://api.github.com/repos/contao/test/issues/comments/2926620"}}