<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Creating ZIP files with PHP</title>
	<atom:link href="http://www.devco.net/archives/2005/05/24/creating_zip_files_with_php.php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.devco.net/archives/2005/05/24/creating_zip_files_with_php.php</link>
	<description>by r.i.pienaar</description>
	<lastBuildDate>Fri, 12 Mar 2010 11:59:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Brad</title>
		<link>http://www.devco.net/archives/2005/05/24/creating_zip_files_with_php.php/comment-page-1#comment-664</link>
		<dc:creator>Brad</dc:creator>
		<pubDate>Thu, 15 Oct 2009 16:20:14 +0000</pubDate>
		<guid isPermaLink="false">http://wp.devco.net/?p=307#comment-664</guid>
		<description>Just so that it is clearly noted, rmdir( ) in php 5 and higher does remove the directory and directory folder completely, which is for those still using php 4 or lower.</description>
		<content:encoded><![CDATA[<p>Just so that it is clearly noted, rmdir( ) in php 5 and higher does remove the directory and directory folder completely, which is for those still using php 4 or lower.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad</title>
		<link>http://www.devco.net/archives/2005/05/24/creating_zip_files_with_php.php/comment-page-1#comment-663</link>
		<dc:creator>Brad</dc:creator>
		<pubDate>Thu, 15 Oct 2009 16:15:07 +0000</pubDate>
		<guid isPermaLink="false">http://wp.devco.net/?p=307#comment-663</guid>
		<description>By the way, sometimes, it is an issue of server setup, php version and just outright clashing of code to have the rmdir() function remove the content but not the actual folder/directory itself. 

 The folder could still be there and as it is empty at that point, php will give you a warning on this. To prevent that from happening, use the &#039; unlink ( ) function, like the code that follows:





Just a little touch of overkill to save some grief later.</description>
		<content:encoded><![CDATA[<p>By the way, sometimes, it is an issue of server setup, php version and just outright clashing of code to have the rmdir() function remove the content but not the actual folder/directory itself. </p>
<p> The folder could still be there and as it is empty at that point, php will give you a warning on this. To prevent that from happening, use the &#8216; unlink ( ) function, like the code that follows:</p>
<p>Just a little touch of overkill to save some grief later.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad</title>
		<link>http://www.devco.net/archives/2005/05/24/creating_zip_files_with_php.php/comment-page-1#comment-662</link>
		<dc:creator>Brad</dc:creator>
		<pubDate>Thu, 15 Oct 2009 15:30:21 +0000</pubDate>
		<guid isPermaLink="false">http://wp.devco.net/?p=307#comment-662</guid>
		<description>Okay guys, a couple of things...

  1. The add_dir limitation issue - 

       Steps: 
          - Create a catchall directory to maintain all of the user based folders/subdirectories created per user/per instance.

          - Create/delete files on an indivudal site upload basis, which can easily be accomplished with mkdir( ) and rmdir( ) functions. This will allow you to set automated cycles as to how long the files stay on your system with the user having access to them during the duration. 

          - Use the file zip system on this posting to take care of the required zip process and output.

   
    2. On the . php files being output in the zip drive as Ben suggested - 

   I have seen that issue before. Don&#039;t put your files in the same directory that you are targeting as your holding directory. You will be able to eliminate that issue by storing your .php files in another directory and calling them to action with a simple include ( )  or require ( ) function.  Note that in most cases, due to header code classes, I suggest using include_once( ) or require_once ( ) to prevent the loop causing errors.

   By calling the process from another source, you protect your code from being hand delivered to the person receiving the zip.</description>
		<content:encoded><![CDATA[<p>Okay guys, a couple of things&#8230;</p>
<p>  1. The add_dir limitation issue &#8211; </p>
<p>       Steps:<br />
          &#8211; Create a catchall directory to maintain all of the user based folders/subdirectories created per user/per instance.</p>
<p>          &#8211; Create/delete files on an indivudal site upload basis, which can easily be accomplished with mkdir( ) and rmdir( ) functions. This will allow you to set automated cycles as to how long the files stay on your system with the user having access to them during the duration. </p>
<p>          &#8211; Use the file zip system on this posting to take care of the required zip process and output.</p>
<p>    2. On the . php files being output in the zip drive as Ben suggested &#8211; </p>
<p>   I have seen that issue before. Don&#8217;t put your files in the same directory that you are targeting as your holding directory. You will be able to eliminate that issue by storing your .php files in another directory and calling them to action with a simple include ( )  or require ( ) function.  Note that in most cases, due to header code classes, I suggest using include_once( ) or require_once ( ) to prevent the loop causing errors.</p>
<p>   By calling the process from another source, you protect your code from being hand delivered to the person receiving the zip.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rody</title>
		<link>http://www.devco.net/archives/2005/05/24/creating_zip_files_with_php.php/comment-page-1#comment-293</link>
		<dc:creator>Rody</dc:creator>
		<pubDate>Tue, 04 Aug 2009 10:04:03 +0000</pubDate>
		<guid isPermaLink="false">http://wp.devco.net/?p=307#comment-293</guid>
		<description>Hi, firts of all, great code. Very simple and very usefull. But I have a problem when I try to create more than four dirs with add_dir function, can you help me?
Thanks and again good job.
Rody
</description>
		<content:encoded><![CDATA[<p>Hi, firts of all, great code. Very simple and very usefull. But I have a problem when I try to create more than four dirs with add_dir function, can you help me?<br />
Thanks and again good job.<br />
Rody</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Althauser</title>
		<link>http://www.devco.net/archives/2005/05/24/creating_zip_files_with_php.php/comment-page-1#comment-292</link>
		<dc:creator>Ben Althauser</dc:creator>
		<pubDate>Thu, 16 Apr 2009 22:47:07 +0000</pubDate>
		<guid isPermaLink="false">http://wp.devco.net/?p=307#comment-292</guid>
		<description>I believe it would be wise to disallow files with the extension *.php if using this script in a GET method that is visible.
Using another zip file creator, I was very easily able to download raw php source in a zip package.
It&#039;s a wonderful script, but if every used in a get method, would be like an open door to a ......possum?
</description>
		<content:encoded><![CDATA[<p>I believe it would be wise to disallow files with the extension *.php if using this script in a GET method that is visible.<br />
Using another zip file creator, I was very easily able to download raw php source in a zip package.<br />
It&#8217;s a wonderful script, but if every used in a get method, would be like an open door to a &#8230;&#8230;possum?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://www.devco.net/archives/2005/05/24/creating_zip_files_with_php.php/comment-page-1#comment-291</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Sun, 29 Mar 2009 06:11:27 +0000</pubDate>
		<guid isPermaLink="false">http://wp.devco.net/?p=307#comment-291</guid>
		<description>@Rafael Miranda,
I have spent hours trying to figure out this problem.  Your suggestion fixed it!  Thanks!
-Ben
</description>
		<content:encoded><![CDATA[<p>@Rafael Miranda,<br />
I have spent hours trying to figure out this problem.  Your suggestion fixed it!  Thanks!<br />
-Ben</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AMANUENSIS</title>
		<link>http://www.devco.net/archives/2005/05/24/creating_zip_files_with_php.php/comment-page-1#comment-290</link>
		<dc:creator>AMANUENSIS</dc:creator>
		<pubDate>Mon, 16 Mar 2009 16:17:13 +0000</pubDate>
		<guid isPermaLink="false">http://wp.devco.net/?p=307#comment-290</guid>
		<description>Hi
I have a script named &#039;SECURELOADS&#039; - it work well except when it is required to zip and download a number of large files together - zipping and downloading a few is now problem, but any attempt to go behond more than a few I get errors like:
Fatal error: Allowed memory size of 524288000 bytes exhausted (tried to allocate 129871054 bytes) in /var/www/vhosts/intentionalnoise.co.uk/httpdocs/sld2/core/hclib/compress/zipfile.php on line 120
the code in the file is below, any ideas as to why it should be doing this?
I have allocated 500mb or ram to it - why is it so hungry?
</description>
		<content:encoded><![CDATA[<p>Hi<br />
I have a script named &#8216;SECURELOADS&#8217; &#8211; it work well except when it is required to zip and download a number of large files together &#8211; zipping and downloading a few is now problem, but any attempt to go behond more than a few I get errors like:<br />
Fatal error: Allowed memory size of 524288000 bytes exhausted (tried to allocate 129871054 bytes) in /var/www/vhosts/intentionalnoise.co.uk/httpdocs/sld2/core/hclib/compress/zipfile.php on line 120<br />
the code in the file is below, any ideas as to why it should be doing this?<br />
I have allocated 500mb or ram to it &#8211; why is it so hungry?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FarhaN</title>
		<link>http://www.devco.net/archives/2005/05/24/creating_zip_files_with_php.php/comment-page-1#comment-289</link>
		<dc:creator>FarhaN</dc:creator>
		<pubDate>Wed, 04 Mar 2009 12:53:44 +0000</pubDate>
		<guid isPermaLink="false">http://wp.devco.net/?p=307#comment-289</guid>
		<description>I m using this script and the archive_zip class available from pear.php.net. When i make archives of jpgs and gifs, i get the zip file but if i try with mp3s ,avis ,sis files i always get error in file creation how can i solve this problem? Should i put above script and change the class?
</description>
		<content:encoded><![CDATA[<p>I m using this script and the archive_zip class available from pear.php.net. When i make archives of jpgs and gifs, i get the zip file but if i try with mp3s ,avis ,sis files i always get error in file creation how can i solve this problem? Should i put above script and change the class?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Free Content</title>
		<link>http://www.devco.net/archives/2005/05/24/creating_zip_files_with_php.php/comment-page-1#comment-288</link>
		<dc:creator>Free Content</dc:creator>
		<pubDate>Fri, 27 Feb 2009 23:51:40 +0000</pubDate>
		<guid isPermaLink="false">http://wp.devco.net/?p=307#comment-288</guid>
		<description>Hello,
Is there a limit to the number of files that can be zipped up as I am using this script and I get an error &quot;Allowed memory size of 16777216 bytes exhausted&quot; when trying it with a large number of files.
Thanks
angela
It depends on your PHP settings. Normally you can increase it with
ini_set(&#039;memory_limit&#039;, &#039;32M&#039;);
as the first line of your script. At the moment you have 16M, so 32M should do.
</description>
		<content:encoded><![CDATA[<p>Hello,<br />
Is there a limit to the number of files that can be zipped up as I am using this script and I get an error &#8220;Allowed memory size of 16777216 bytes exhausted&#8221; when trying it with a large number of files.<br />
Thanks<br />
angela<br />
It depends on your PHP settings. Normally you can increase it with<br />
ini_set(&#8216;memory_limit&#8217;, &#8216;32M&#8217;);<br />
as the first line of your script. At the moment you have 16M, so 32M should do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Qk</title>
		<link>http://www.devco.net/archives/2005/05/24/creating_zip_files_with_php.php/comment-page-1#comment-287</link>
		<dc:creator>Qk</dc:creator>
		<pubDate>Tue, 24 Feb 2009 18:16:19 +0000</pubDate>
		<guid isPermaLink="false">http://wp.devco.net/?p=307#comment-287</guid>
		<description>Hi,
I have to archive some rather large files (80+MB already compressed)
and I was wondering if somebody had a solution where by I could simply add 2 of these files into a zip file.
The main obstacle to using most zipping scripts is that some servers have a memory usage limit. When that limit is too low (as would be the case with most shared hosting),  php can&#039;t do the job.
I was wondering if adding a file without trying to compress would help.
Any ideas?
</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I have to archive some rather large files (80+MB already compressed)<br />
and I was wondering if somebody had a solution where by I could simply add 2 of these files into a zip file.<br />
The main obstacle to using most zipping scripts is that some servers have a memory usage limit. When that limit is too low (as would be the case with most shared hosting),  php can&#8217;t do the job.<br />
I was wondering if adding a file without trying to compress would help.<br />
Any ideas?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
