Jump to content

audio download issue - cutting off last few minutes of audio message


shagen

Recommended Posts

On the tail end of a project and my programmer has left me hanging. I am trying to download Audio files that are sometimes 20mb and larger and I am I am on a yahoo server. The file will download and even play but it does a few different things. It will sometimes split it into two files, and it cuts of the last few minutes of the audio message no matter if it is split into multiple files or not. I know the audio files are good because you can the other option I have is for them to play right in the browser and they are complete when doing so.

 

Any help, suggestions would be much appreciated. Thanks for your time!

 

Here is the first piece of code...

 

if(isset($_GET['md'])){
        $bid = $database->e($_GET['bid']);
        set_time_limit(0);
        ini_set("memory_limit","50000M");
        $book = $database->load("SELECT * FROM media WHERE id='$bid' LIMIT 1");
        header("Pragma: public"); // required
        header("Expires: 0");
        header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
        header("Cache-Control: private",false); // required for certain browsers
        header("Content-Transfer-Encoding: binary");
        header("Content-type: application/octet-stream");
        header("Content-Disposition: attachment; filename=\"{$book[0]['filename']}\"");
        header('Content-Length: '.filesize("media/{$book[0]['filename']}"));
        readfile("media/{$book[0]['filename']}");
        die;
}

 

... and this is what is controlling the link for download...

 

<div class="mediaControls">
<a class="mediaDownload" alt="Download" title="Download Audio" href="?md=1&bid=<?=$book['id']?>"></a>
</div>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.