Hi Jazzman (u by any chance play the saxophone like me?)
Permission to unzipped items:
Directory:
in filezilla: adfrw (0755) 33 33
in commandprompt: drwxr-xr-x 1 www-data www-data 4096 Feb 16 13:42 a1 (dir)
File:
in filezilla: flcdmpe (0644) 33 33
in commandprompt: -rw-r--r-- 1 www-data www-data 8 Feb 16 13:42 aaa.txt
I am using a php-script (see below) that is ftp'd to the same directory on server where the zip-file lies.
Opening the file (in this case) will trigger the unzip. Normally I have an little interface for selecting the zipfile + other options (delete php-unzipper)
Since I cannot detect an upload- / attach button, I'll hand you the code as text.
The code was written by a certain Yarms. You can find it at http://php.net/manual/ro/ref.zip.php (needs a bit of scrolling down)
Gr.
Arthur
-------------------------
<?php function unzip($file){ $zip=zip_open(realpath(".")."/".$file); if(!$zip) {return("Unable to proccess file '{$file}'");} $e=''; while($zip_entry=zip_read($zip)) { $zdir=dirname(zip_entry_name($zip_entry)); $zname=zip_entry_name($zip_entry); if(!zip_entry_open($zip,$zip_entry,"r")) {$e.="Unable to proccess file '{$zname}'";continue;} if(!is_dir($zdir)) mkdirr($zdir,0777); #print "{$zdir} | {$zname} \n"; $zip_fs=zip_entry_filesize($zip_entry); if(empty($zip_fs)) continue; $zz=zip_entry_read($zip_entry,$zip_fs); $z=fopen($zname,"w"); fwrite($z,$zz); fclose($z); zip_entry_close($zip_entry); } zip_close($zip); return($e); } function mkdirr($pn,$mode=null) { if(is_dir($pn)||empty($pn)) return true; $pn=str_replace(array('/', ''),DIRECTORY_SEPARATOR,$pn); if(is_file($pn)) {trigger_error('mkdirr() File exists', E_USER_WARNING);return false;} $next_pathname=substr($pn,0,strrpos($pn,DIRECTORY_SEPARATOR)); if(mkdirr($next_pathname,$mode)) {if(!file_exists($pn)) {return mkdir($pn,$mode);} } return false; } unzip("test.zip"); ?>