Hello, group:
I'm able to successfully add files to a zip archive using php with the
following script, but I can't find anywhere I add directories, can
somebody help?
Thanks,
--TJ
<?php
$zip = new ZipArchive();
$filename = "./test112.zip";
if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {
exit("cannot open <$filename>\n");
}
$zip->addFromString("testfilephp.txt" . time(), "#1 This is a test
string added as testfilephp.txt.\n");
$zip->addFromString("testfilephp2.txt" . time(), "#2 This is a test
string added as testfilephp2.txt.\n");
$zip->addFile($thisdir . "/too.php","/testfromfile.php");
$zip->close();
?> 1 3261
On 29 Lut, 18:26, "techjoh...@gmail.com" <techjoh...@gmail.comwrote:
Hello, group:
I'm able to successfully add files to a zip archive using php with the
following script, but I can't find anywhere I add directories, can
somebody help?
Thanks,
--TJ
<?php
$zip = new ZipArchive();
$filename = "./test112.zip";
if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {
exit("cannot open <$filename>\n");
}
$zip->addFromString("testfilephp.txt" . time(), "#1 This is a test
string added as testfilephp.txt.\n");
$zip->addFromString("testfilephp2.txt" . time(), "#2 This is a test
string added as testfilephp2.txt.\n");
$zip->addFile($thisdir . "/too.php","/testfromfile.php");
$zip->close();
?>
$zip->AddEmptyDirectory($_folderName)
if you wish to add file to this directory:
$zip->AddFile($_folderName .'/' . $_file); This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Wysiwyg |
last post by:
Is there any way to add an embedded resource to a project without copying it
to the project's directory? I have shared resources and don't want each
project using the images, xml files, etc. to...
|
by: Kiran |
last post by:
Hi,
If I create a Virtual directory with application name
programmatically it will not show up in the available web
services while adding web reference(Dynamic discovery
fails).
Where as if I...
|
by: Dmitry Korolyov [MVP] |
last post by:
When we use
btnSubmit.Attributes = "javascript: this.disabled=true;"
to make the button disabled and prevent users from clicking it again while
form data still posting, there is no longer...
|
by: Leo_Surf |
last post by:
Hello,
I need your help adding user in Active Directory from ASP.net website. Could
any one provide me the complete code for the html page. As this is my
curriculam project and I dont have any...
|
by: MIGUEL |
last post by:
Hi all,
I'm quite lost with how adding web references to a project creates proxy
classes.
I've developed a web service with two classes inside and that contains three
references to three...
|
by: Skeleton Man |
last post by:
Hi,
I'm running IIS with PHP 4.3.11 and I'm trying to get zip support working
correctly.
I have installed the appropriate dll, it shows zip support in phpinfo() and
the basic...
|
by: AndyL69 |
last post by:
Hello
I've got a very strange Problem. When im adding a new ACE entry to a UNC Direcotry the inherented ACL's will be lost. When I'm adding a new ACE to a directory / file in this UNC path the...
|
by: ChronoFish |
last post by:
Hello,
I can successfully open and explore zip files using the ZipArchive
class provided by PHP 5.2.1, but I get an ER_NOZIP error when opening
large zip files. At least that appears to be the...
|
by: Ryan van Roode |
last post by:
Hello,
Is there a way to use php's ZipArchive and specify No Compression?
Something similar to "zip -0" on the command line. Thanks very much.
~rvr
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |