RE: [PHP] PHP Zip Question
| From: | Matt Street | Date: | Mon, 06 Nov 2006 12:28:27 +0000 |
| Subject: | RE: [PHP] PHP Zip Question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-244252@lists.php.net to get a copy of this message | ||
Thanks for the response, I decided that it was easier to unpack the zip
during the upload process and then delete the zip. I can then indicate
which files I want to zip up and this works (opening the zip on the
server), but, and it's a big but, when the zip is downloaded to the
users machine it is being corrupted!
To force the download I use:
header('Content-type: application/zip');
header('Content-Disposition: attachment; filename='.$tutorzipfile);
readfile($filename);
Which correctly gives me:
Content-Type: application/zip
Content-disposition: attachment; filename=tutorzipfile.zip
when viewing the LiveHTTPHeaders extension in firefox.
However, when I view the zip file that is downloaded to my machine, in
Textpad, php has appended the directory information of the files I'm
zipping up onto the front of the zip file, so it no longer starts PK!!!
Anyone any ideas???
Thanks in advance
Matt