I am trying to unzip a file that is located at C:/Documents and Settings/scorpio1/My Documents/Downloads/cmsnew.zip and want to extract contents to C:\wamp\www. but the folder that will be extracted is already existed. I want that if that folder already exists, it should be replaced by the folder created after unzipping. I am getting this error.
Warning: ZipArchive::extractTo(C:/wamp/www//cmsFinalUpdate\admin\images/Thumbs.db): failed to open stream: Permission denied in C:\wamp\www\cmsFinalUpdate\extract_and_move.php
My code snippet is:
<?php
//Step 01
$zip = new ZipArchive();
if ($zip->open('C:/Documents and Settings/scorpio1/My Documents/Downloads/cmsnew.zip')=== TRUE) {
$zip->extractTo('C:/wamp/www/');
$zip->close();
echo "file extracted";
}
else
{
echo "Try Again";
}
?>