mp3 file stops playing

Re: mp3 file stops playing

by Robert Brenstein -
Number of replies: 0
I just ran into the same problem: students reported problems downloading large PDF files. Luckily for me, I just read about this PHP bug here big grin

In my installation (OSX 10.3.8, PHP 5.0.4, Moodle 1.4.4+), the file to patch is

/moodle/file.php

And the actual PHP code to replace readfile() is:

  if (filesize($pathname) < 2000000) {
    readfile($pathname);
  } else {
    $fp = fopen($pathname,"rb");
    while (strlen($data = fread($fp,256*1024))) {
      echo $data;
    }
    fclose($fp);
  }


Actually, since I do not filter downloadable files, I needed to replace only the second readfile().