You are here: Re: Strange download script problem « PHP Programming Language « IT news, forums, messages
Re: Strange download script problem

Posted by Paul Lautman on 07/29/07 10:37

Raffi 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);

See
http://www.evolt.org/article/Using_MySQL_and_PHP_to_Present_Excel_Spreadsheets/20/26896/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация