Barry wrote:
J_K9 wrote:
This is what I used:
----
<?php
// fix for IE catching or PHP bug issue
header("Pragma: public");
header("Expires: 0"); // set expiration time
header("Cache-Control: must-revalidate, post-check=0,
pre-check=0");
// browser must download file from server instead of cache
// force download dialog
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
// Path to your file
$path = "zipdata/downloadme.zip";
// use the Content-Disposition header to supply a
// recommended filename and
// force the browser to display the save dialog.
header("Content-Disposition: attachment; filename=".$path.";");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($path));
readfile($path);
?>
----
As you can see, there is no output before the headers are set. In
fact, the error say that the headers were set on line 6, which is
<?php. How can this be? Is there something I need to turn off like
default headers?
Thanks,
J_K9
What is before line 6?
Because the <?php should be at line 1
could you post the code from line 1 to line 10?
Lines 1-10:
----
<html>
<head>
<title>Downloads</title>
</head>
<body>
<?php
// fix for IE catching or PHP bug issue
header("Pragma: public");
header("Expires: 0"); // set expiration time
----
Should I remove the HTML?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php