Friday 8 January 2016

Working with PHP ZipArchieve Class


This happened today, it was my first time working with zip file.
The issue came up when i opened the file like this:

$zFile = $zip->open($filePath,  \ZipArchive::OVERWRITE);
$zip->extractTo($bookDir);

After opening the file i was trying to extract to another directory, this returns true but no extracted data was found.
The is a really troublesome bug, but thank God for the internet.
After sometime i debugged and removed the \ZipArchive::OVERWRITE and it worked.

$zFile = $zip->open($filePath);
$zip->extractTo($bookDir);





Follow me on twitter: http://www.twitter.com/_josiah_king Join me on Google+: https://www.plus.google.com/u/0/113541005774136102412/posts/p/pub?cfem=1

No comments:

Post a Comment