Reply to unzipping while preserving permissions

Your name:

Reply:


Posted by laredotornado@zipmail.com on 11/21/06 17:06

Hi,

I'm using PHP 4.4.4 with Apache 2 on Linux. I have a PHP function to
unzip a file, but I would like the resulting unzipped file with all its
sub-directories and files to have the same permissions as the parent
file, or at least 755 perms. Right now, it is being created with
rw-r--r-- perms. Here is my function

function unzipFile($p_zip_file_path, $p_zip_file_pwd,
$unzip_dir)
{
$cmd = "unzip ";
if (!empty($p_zip_file_pwd)) {
$cmd .= " -P $p_zip_file_pwd ";
} //
$cmd .= " -o -d $unzip_dir $p_zip_file_path 2>&1";
exec($cmd, $output, $return);
// failed if non-zero
if ($return != 0) {
$output = join("<BR>\n", $output) . "<BR>\n";
return $output;
} // if
return "";
}

Any suggestions on how to modify it? Thanks, - Dave

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация