br0ken Posted March 10, 2009 Share Posted March 10, 2009 I'm creating a log file on the fly. This information is then added to a zip folder using the addFromString() method. This works fine for a small sized log file (about 200 chars) but any thing bigger and the Zip folder refuses to extract. Any one have any idea why this could be? Here is my code: $path = GetVar("CMS_DIR_BACKUP_DATA"); $zip = new ZipArchive(); $res = $zip->open($path.$fname.".zip", ZIPARCHIVE::CREATE); if ($res === true) { $zip->addFromString($fname.".txt", $content); $zip->close(); } Link to comment https://forums.phpfreaks.com/topic/148798-solved-zip-extension/ Share on other sites More sharing options...
redarrow Posted March 10, 2009 Share Posted March 10, 2009 cheek this out really good zipping program very easy to use. http://www.phpconcept.net/index.en.php?PHPSESSID=8cbe29ab462b579bda15a0ca250d7887 Link to comment https://forums.phpfreaks.com/topic/148798-solved-zip-extension/#findComment-781377 Share on other sites More sharing options...
br0ken Posted March 10, 2009 Author Share Posted March 10, 2009 Thank you but I wish to use my own code as I know it should be relatively simple. The code I posted above is identical to the code on the PHP examples page so I'm sure why it isn't working! Link to comment https://forums.phpfreaks.com/topic/148798-solved-zip-extension/#findComment-781403 Share on other sites More sharing options...
redarrow Posted March 10, 2009 Share Posted March 10, 2009 Can you set the size off the zip folder, is there a setting ? does not sound like a permission prob lam but sounds like the zip's are set at a default size. can you kindly point me to the page, where your creating the zip's code from. Link to comment https://forums.phpfreaks.com/topic/148798-solved-zip-extension/#findComment-781408 Share on other sites More sharing options...
br0ken Posted March 10, 2009 Author Share Posted March 10, 2009 I got the code from here: http://uk2.php.net/manual/en/zip.examples.php It definately isn't a permissions problem as a Zip file is created, it just is created incorrectly. Link to comment https://forums.phpfreaks.com/topic/148798-solved-zip-extension/#findComment-781418 Share on other sites More sharing options...
Mark Baker Posted March 10, 2009 Share Posted March 10, 2009 If on Windows, watch out for http://pecl.php.net/bugs/bug.php?id=9278 Link to comment https://forums.phpfreaks.com/topic/148798-solved-zip-extension/#findComment-781441 Share on other sites More sharing options...
br0ken Posted March 10, 2009 Author Share Posted March 10, 2009 Thanks Mark, that appears to be my problem! Link to comment https://forums.phpfreaks.com/topic/148798-solved-zip-extension/#findComment-781471 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.