|
|
Unzip/Extract an uploaded file using php - PHP
|
Views : 301
|
|
Tagged in : PHP
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
Here is a simple which helps you to Unzip/Extract an uploaded file using php
<?php
$zip = new ZipArchive;
$res = $zip->open('zip_file_name.zip');
if ($res === TRUE) {
$zip->extractTo('dir_name/');
$zip->close();
echo 'Extracted';
} else {
echo 'Failed to Extract';
}
?>
Basically it extracts the zip file into the directory you specify… make sure the directory you want to extract it to has write permissions.
|
|
By - Sanju, On - 2010-06-24 |
|
|
|