unknown time remaining (force download)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ykach
Forum Newbie
Posts: 1
Joined: Fri Apr 01, 2011 7:22 am

unknown time remaining (force download)

Post by ykach »

im using this code:

Code: Select all

<?php
set_time_limit(0); 
$file = 'test.mp3'; 


header('Content-Description: File Transfer');
header("Content-Disposition: attachment; filename=\"$file\"");
header('Content-Type: audio-x/mp3');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($file));
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Expires: 0');


readfile($file);
?>

when downloading i cant see the progress bar.

thanks.
Post Reply