note 83162 added to ref.zip
| From: | cusimar9 at hotmail dot com | Date: | Tue, 13 May 2008 16:06:45 +0000 |
| Subject: | note 83162 added to ref.zip | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139335@lists.php.net to get a copy of this message | ||
Just to second the comments above and say that the zipfile class in phpMyAdmin is excellent.
There are 2 files when you download phpMyAdmin:
\libraries\zip.lib.php
\libraries\unzip.lib.php
Here is a small example:
$zip = new zipfile();
$filename = "1.jpg";
$fsize = @filesize($filename);
$fh = fopen($filename, 'rb', false);
$data = fread($fh, $fsize);
$zip->addFile($data,$filename);
$zipcontents = $zip->file();
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"TheZip.zip\"");
header("Content-length: " . strlen($zipcontents) . "\n\n");
// output data
echo $zipcontents;
----
Server IP: 87.124.64.96
Probable Submitter: 213.143.7.138
----
Manual Page -- http://www.php.net/manual/en/ref.zip.php
Edit -- https://master.php.net/note/edit/83162
Del: integrated -- https://master.php.net/note/delete/83162/integrated
Del: useless -- https://master.php.net/note/delete/83162/useless
Del: bad code -- https://master.php.net/note/delete/83162/bad+code
Del: spam -- https://master.php.net/note/delete/83162/spam
Del: non-english -- https://master.php.net/note/delete/83162/non-english
Del: in docs -- https://master.php.net/note/delete/83162/in+docs
Del: other reasons-- https://master.php.net/note/delete/83162
Reject -- https://master.php.net/note/reject/83162
Search -- https://master.php.net/manage/user-notes.php