|
Posted by dourdoun@gmail.com on 07/29/07 13:21
This is similar to your case:
http://in.php.net/manual/en/function.header.php#73416
On Jul 29, 10:46 am, Raffi <thegrizz...@yahoo.com> wrote:
> I have a php script which generates a zip file that contains an ASCII
> text file. The script then prompts the user to save/open the zip file.
> The script is on a server that is behind an Apache proxy server. Using
> Firefox, the download works fine and everything goes as intended.
> However, IE7 tries to download the php script instead of the zip file,
> resulting in an access error.
>
> Below are the pertinent portions of the script.
>
> Any help is greatly appreciated.
>
> Raffi
>
> --------------------------------------------------------------------------------------------------------
>
> $file_name = "/tmp/Export.zip";
>
> $size = filesize($file_name);
>
> //Set headers
> header("Cache-Control: public");
> header("Content-Description: File Transfer");
> header("Content-Disposition: attachment; filename=Export.zip");
> header("Content-Length: $size");
> header("Content-Type: application/zip");
> header("Content-Transfer-Encoding: binary");
>
> //Read the file from disk
> readfile($file_name);
Navigation:
[Reply to this message]
|