ZipArchive question
| From: | Jeffry Killen | Date: | Wed, 08 Apr 2015 05:47:03 +0000 |
| Subject: | ZipArchive question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-324781@lists.php.net to get a copy of this message | ||
Hello;
Sorry in advance if I am over working this list.....
I am attempting to get acquainted with the ZipArchive class
I have a page that self processes get and post vars.
In the following code an async get query is sent and processed successfully
(this is all local with no access from public network or cats walking on keyboards)
$_arch = new ZipArchive;
if($_GET['test'])
{
$_retStr = $_arch->open('test.zip', ZIPARCHIVE::CREATE);
if($_retStr === TRUE || $_retStr == ZIPARCHIVE::ER_EXISTS)
{
if($_arch->addFromString('test.txt', 'here is some nonsense for the sake of an argument.'))
{
$_arch->close();
$_retStr = "good to go:\n".$_GET['test'];
}
else
{
$_arch->close();
$_retStr = "no bueno:\n".$_GET['test'];
}
}
else
{
$_retStr .= "Error Code: ".$_retVal."\n".$_GET['test'];
}
header('Content-Type: text/plain');
print $_retStr;
exit;
}
My question is: Where is the test.zip archive file located? (/tmp, maybe?)
I would expect it to be in the same dir as the processing script, but I don't see anything in the dir
by the name of test.zip.
I know this is not command line gzip but I seem to remember working with gzip or bzip on the
command line and seeing a visible archive file.
Thanks for time and attention
JK