RE: [PHP-ES] Problemas con MAC && PHP

From: Date: Tue, 16 Sep 2003 09:26:55 +0000
Subject: RE: [PHP-ES] Problemas con MAC && PHP
Groups: php.general.es 
Request: Send a blank email to general-es+get-40471@lists.php.net to get a copy of this message
Hola, yo te paso mis headers que uso en un script para hacer download, y te fijas si te sirve. Más que nada para que veas las diferencias, de como se contruyen los headers dependiendo del navegador. if (!empty($file['file_data'])) { if (get_user_os() == "MAC") { header("Content-Type: application/x-unknown\n"); header("Content-Disposition: attachment; filename=\"".$file ['file_name']."\"\n"); } elseif (get_browser_info() == "MSIE") { $disposition = (!eregi("\.zip$", $file['file_name']) && $action ! = "zip" && $action != "lightbox") ? 'attachment' : 'inline'; header("Content-Disposition: $disposition; filename=\"".$file ['file_name']."\"\n"); header("Content-Type: application/x-ms-download\n"); } elseif (get_browser_info() == "OPERA") { header("Content-Disposition: attachment; filename=\"".$file ['file_name']."\"\n"); header("Content-Type: application/octetstream\n"); } else { header("Content-Disposition: attachment; filename=\"".$file ['file_name']."\"\n"); header("Content-Type: application/octet-stream\n"); } header("Content-Length: ".$file['file_size']."\n\n"); echo $file['file_data']; } Un saludo, Danny

« previous php.general.es (#40471) next »