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); ?> Link to comment https://forums.phpfreaks.com/topic/127993-download-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.