free mojo
07-16-2004, 07:28 PM
hello, i've been trying to use this "forcer" to make the link to my mp3 ask you to open or save the mp3. It asks you then downloads instantly and it says the file extension is unidentified in wmplayer.
Here is the php (where i think the error must be):
<?php
$basedir = "http://www.freemojo.co.uk/public_html/main/mp3/";
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;
?>
it's called from a txt file like this <a href="forcer.php?file="myfilename.mp3"> link </a>
Here is the php (where i think the error must be):
<?php
$basedir = "http://www.freemojo.co.uk/public_html/main/mp3/";
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;
?>
it's called from a txt file like this <a href="forcer.php?file="myfilename.mp3"> link </a>