singapore: the smallest big galery
home » forum » General » help me..the zip upload...??

You are not logged in.

#1 2007-12-23 15:41:04

sss912042
Member

help me..the zip upload...??

help me about the zip upload

i not upload the zip

this is my code:

function addMultipleImages()
  {
      /// Path to the tmp directory
    $tmpdir="../galleries";
       
    $archive = $_FILES["sgArchiveFile"]["tmp_name"];
 
    if(!is_uploaded_file($archive)) {
      $this->lastError = $this->i18n->_g("Could not upload file");
      return false;
    }
    /////// old method /////////
    /*decompress archive to temp
    $cmd  = escapeshellcmd($this->config->pathto_unzip);
    $cmd .= ' -d "'.escapeshellcmd(realpath($tmpdir));
    $cmd .= '" "'.escapeshellcmd(realpath($archive)).'"';
   
        if(!exec($cmd)) {
      $this->lastError = $this->i18n->_g("Could not decompress archive");
      return false;
     }
    */
   
    //////// new Method ///////
       
    include('pclzip.lib.php');
  $archive = new PclZip(realpath($archive));
  if ($archive->extract(PCLZIP_OPT_PATH,$tmpdir ) == 0) {
    die("Error : ".$archive->errorInfo(true));
  }

   
    //start processing archive contents
    $wd = $tmpdir;
    $contents = $this->getListing($wd,"images");

in php.ini :

upload_tmp_dir = "C:/WINDOWS/Temp/"

help me...thanks everyone...

Last edited by sss912042 (2007-12-29 05:26:52)

Offline