Re: Problemas con MAC && PHP
| From: | Vicente | Date: | Mon, 15 Sep 2003 21:27:30 +0000 |
| Subject: | Re: Problemas con MAC && PHP | ||
| References: | 1 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-40447@lists.php.net to get a copy of this message | ||
prueba esto:
Si te da avisos de "Cannot add headers..." entonces
pon: ob_start(); al principio de la página php.
mas o menos así:
<?
ob_start();
// **** el javascript de abajo fuera del codigo php
//
?>
<SCRIPT>
// Distinguiendo Mac o PC
if (navigator.appVersion.indexOf("Win")!=-1) {
document.write('<?=$filename =
$row_rsQuery_select['photoname'].".psd";?>');
} else {
document.write('<?=$filename = "http://www.tusite.com/".$row_rsQuery_select['photoname'].".psd";?>');
}
</SCRIPT>
<?
$size = filesize($filename);
header("Pragma: no-cache");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Expires: 0");
header("Content-Transfer-Encoding: binary");
header("Content-type: application/force-download");
header("Content-Disposition: attachment; filename=$filename");
header("Content-Length: $size");
readfile("$filename");
?>