Ignore:
Timestamp:
Oct 16, 2014 10:22:23 AM (11 years ago)
Author:
quyenla
Message:

lala

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pro-bachkim-filespace/sourcecode/api.violet.vn/www/apps/platform/modules/space/actions/actions.class.php

    r280 r281  
    326326    $this->aryNewTree = $aryNewTree;
    327327  }
    328      
    329  public function executeSpaceupload()
    330  {
    331      
    332     $userId = $this->getRequestParameter('userid');
    333    
    334      $catId = $this->getRequestParameter('dir');
    335      
    336     if ($this->getRequest()->hasErrors()) return false;
    337     if (!$this->getRequest()->hasFiles()) return true;
    338 
    339     $file = reset($this->getRequest()->getFileNames());
    340 
    341     $fileName = $this->getRequest()->getFileName($file);
    342     $fileType = $this->getRequest()->getFileType($file);
    343     $fileSize = $this->getRequest()->getFileSize($file);
    344     $fileError = $this->getRequest()->hasFileError($file);
    345     $fileErrorNum = $this->getRequest()->getFileError($file);
    346     if ($fileErrorNum || $fileError) return false;
    347 
    348     $tempFile = violetUtil::getTempPath().$userId.'_'.$fileName;
    349    
    350     $this->getRequest()->moveFile($file, $tempFile);
    351  
    352       if ($this->getRequestParameter('unpack') == 'true') {
    353       $tempPath = violetUtil::getTempPath($userId.'_'.date("YmdHis"), true);
    354       myZip::Unzip($tempFile, $tempPath);
    355       $this->MoveDirToSpace($tempPath, $catId, $userId);
    356       unlink($tempFile);
    357     } else {
    358       $this->CreateSpaceFile($tempFile, $fileName, $fileSize, $catId, $userId);
    359     }
    360      
    361     echo '{"status":"success"}';
    362     return sfView::NONE;
    363  }
     328
    364329 public function executeUpload() {
    365330    //if (!$this->checkAuthentication()) return sfView::NONE;
Note: See TracChangeset for help on using the changeset viewer.