I changes it now so it is... header('Content-Type: application/octet-stream'); header("Content-Disposition: attachment; filename=$file_name"); echo $content; exit; Which works on ie7 but safari still downloads the .php R. ""Hulf"" <ross@xxxxxxxxxxxxxx> wrote in message news:66.B4.23381.DC73A074@xxxxxxxxxxxxxxx > The problem I am getting is safari just downloads the .php file. IE7 > corrupts the binary file. It opens fine on FF and IE6. Is this a headers > problem? > > Thanks, > > > R. > > > <?php > > if(isset($_GET['id'])) > { > > > $id = $_GET['id']; > $query = "SELECT file_name, type, size, content FROM results WHERE id = > '$id'"; > > $result = mysql_query($query) or die(mysql_error());; > list($file_name, $type, $size, $content) = mysql_fetch_array($result); > > /*echo $file_name; > echo $type; > echo $size;*/ > > > header("Content-Type: $type"); > header("Content-Disposition: attachment; filename=$file_name"); > header("Content-Length: ".filesize($file)); > header("Accept-Ranges: bytes"); > header("Pragma: no-cache"); > header("Expires: 0"); > header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); > header("Content-transfer-encoding: binary"); > > echo $content; > exit; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php