Changeset 250 for pro-bachkim-filespace


Ignore:
Timestamp:
Oct 16, 2014 9:26:29 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

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