AndySmith
08-12-2004, 03:01 PM
Hi,
I'm using this script (thanks to freddycodes) to force download mp3 files. It works fine on PC's but doesn't work on MACs.
<?php
header("HTTP/1.0 204 No Content");
$basedir = "http://www.website.com/audio/";
header("Content-Type: octet/stream");
header("Content-Disposition: attachment; filename=\"".$_GET['file']."\"");
$fp = fopen($basedir.$_GET['file'], "r");
$data = fread($fp, filesize($basedir.$_GET['file']));
fclose($fp);
print $data;
}
?>
Does anyone have any ideas?
Thanks,
Andy
I'm using this script (thanks to freddycodes) to force download mp3 files. It works fine on PC's but doesn't work on MACs.
<?php
header("HTTP/1.0 204 No Content");
$basedir = "http://www.website.com/audio/";
header("Content-Type: octet/stream");
header("Content-Disposition: attachment; filename=\"".$_GET['file']."\"");
$fp = fopen($basedir.$_GET['file'], "r");
$data = fread($fp, filesize($basedir.$_GET['file']));
fclose($fp);
print $data;
}
?>
Does anyone have any ideas?
Thanks,
Andy