centenial Posted June 5, 2009 Share Posted June 5, 2009 Hi, I'm using PHP's ZipArchive class to extract a ZIP file to a temporary folder. I run a task on the files in that folder. Then I want to delete the folder. The problem is that I can't delete the folder created by the zip - I'm given this error: [05-Jun-2009 12:35:08] PHP Warning: unlink(upload) [<a href='function.unlink'>function.unlink</a>]: Permission denied in unzip.php This is my code - any idea what I'm doing wrong? <?php $zip = new ZipArchive; $res = $zip->open('upload.zip'); if ($res === TRUE) { $zip->extractTo('upload'); $zip->close(); // do stuff here unlink('upload'); } ?> I even tried adding this before I extract the zip: mkdir('upload',0777); That didn't work. So I tried this before I unlink the folder. chmod('upload',0777); That didn't work either. Any ideas? Thanks! Link to comment https://forums.phpfreaks.com/topic/161089-php-unlink-error-cant-delete-folder-extracted-from-zip/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.