frobak Posted October 11, 2008 Share Posted October 11, 2008 Thsi file open a dialog box to open the index page and not the mp3 file. ANy idea why this happen? <?php include '../functions/db_connect.inc.php'; $sql = ("INSERT INTO downloadcount (downloadid) VALUES ('$_REQUEST[downloadreq]')"); $result = @mysql_query($sql,$connection) or die(mysql_error()); $filename = "milli.mp3"; $myFile = "/httpdocs/djneils/mixes/milli.mp3"; $mm_type="application/octet-stream"; header("Cache-Control: public, must-revalidate"); header("Pragma: hack"); // WTF? oh well, it works... header("Content-Type: " . $mm_type); header("Content-Length: " .(string)(filesize($myFile)) ); header('Content-Disposition: attachment; filename="'.$filename.'"'); header("Content-Transfer-Encoding: binary\n"); readfile($myFile); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.