• I uploaded several files. Downloading using the Buddydrive interface on front-end results in corrupted files. Going to the uploads folder on the server and downloading files is fine, so issue had to be in the Buddydrive download process.

    In file buddydrive-item-actions.php in function buddydrive_file_downloader() I changed the lines

    while ( ob_get_level() > 0 ) {
      ob_end_flush();
    }

    to

    while ( ob_get_level() > 0 ) {
      ob_end_clean();
      ob_end_flush();
    }

    I’m guessing that some included file has a line return at the end that was in the ob and getting flushed to the start of the file downloading (there was another issue with bp-custom.php whitespace doing this 8 months ago).

    My site is working now, but I don’t like editing plugin code, is there a reason ob_end_flush() is being used here instead of ob_end_clean() and do you have plans to patch this issue?

    The other strange thing is that I used 2015 theme and removed all plugins except buddypress/drive and still had the issue. But on a clean install on a test site with same setup I did not have the issue.

    • This topic was modified 7 years, 7 months ago by atmojones.
    • This topic was modified 7 years, 7 months ago by atmojones.
  • The topic ‘Files corrupted when downloading’ is closed to new replies.