FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » problem in creating Zip file
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: problem in creating Zip file [message #178819 is a reply to message #178808] Thu, 09 August 2012 04:37 Go to previous messageGo to previous message
salil.ag is currently offline  salil.ag
Messages: 1
Registered: August 2012
Karma:
Junior Member
try with max_execution_time with some lower value, 5 Hr is too much.


On Wednesday, 8 August 2012 12:10:25 UTC+5:30, Supriya wrote:
> Hi All
>
> i m trying to create a Zip file of 1 folder which contains 2 folders and 33 files but the resulted zip file only contains 21 file and 1 folder.And when i open the files of zip folder it says files r corrupted.
>
>
>
> Here is my code:
>
> Plz help me to find out what is wrong there...
>
>
>
> <?php
>
>
>
> include("variable.php");
>
>
>
> ini_set("max_execution_time", 18000);
>
>
>
>
>
> // create object
>
>
>
> $zip = new ZipArchive();
>
>
>
> // open archive
>
>
>
> if ($zip->open($outputfoldername . ".zip", ZIPARCHIVE::CREATE) !== TRUE) {
>
> die ("Could not open archive");
>
> }
>
>
>
> // initialize an iterator
>
> // pass it the directory to be processed
>
>
>
> $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($outputfoldername . "/"));
>
>
>
> // iterate over the directory
>
> // add each file found to the archive
>
>
>
> foreach ($iterator as $key=>$value) {
>
> $zip->addFile(realpath($key), $key) or die ("ERROR: Could not add file: $key");
>
> }
>
>
>
> // close and save archive
>
>
>
> $zip->close();
>
> echo "Archive created successfully.";
>
> ?>
>
>
>
> Thanks
>
> Regards Supriya
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to make Apache to allow an executable to leave a file?
Next Topic: PHP Debugger which can set breakpoint and view variables on watch window
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 04:32:49 GMT 2024

Total time taken to generate the page: 0.04344 seconds