ZipArchive::extractTo doesn't working on Windows Platform -
i'm using following code (windows hosting - plesk/win) :
<?php $zip = new ziparchive; $res = $zip->open('file.zip'); if ($res === true) { $path = getcwd(); $path = str_replace("/","\\",$path); echo $path; $zip->extractto('e:\\vhosts\\domain.com\\httpdocs\\test\\'); $zip->close(); echo 'ok!'; } else { echo 'error!'; } ?>
when run code, following message appears:
warning: ziparchive::extractto(e:\vhosts\domain.com\httpdocs\test/image1.jpg) [ziparchive.extractto]: failed open stream: permission denied in e:\vhosts\domain.com\httpdocs\test\extractphp.php on line 10
i don't why command put slash before unzipped file (test/image1.jpg).
how can resolve issue ?
Comments
Post a Comment