Just wondered if someone could shed some light on the situation.
I have written a piece of code to be precise its on my test site
http://braindeaf.co.uk/downloads/popular.php
It sends mp3 files to the output using the following method
SNIP--
if ($file = file_exists($file_path)) {
header("Cache-control: private");
#header("Content-Type: application/octet-stream");
header("Content-Type: audio/x-mp3");
header("Content-Length: " . filesize($file_path));
header("Content-Disposition: attachment; filename=" . $filename);
$fp = fopen($file_path,"r") or die ("can't open file");
if ($fp) {
while (!feof($fp)) {
print $data .= fread($fp, 1024);
flush();
}
fclose($fp);
}
SNIP--
which is pretty standard. Problem is that the browser won't allow me to view any other pages in the same browser while this download is taking place. I have read that you have to redirect the output to a file or some or another output stream (in the passthru manual notes) but I am unsure how to implement this. Can anyone suggest any changes/ammedments? or any sources of more info?
Thanks kindly.