Exemplo n.º 1
0
 public function upload(Gpf_Rpc_Params $params){
     $form = parent::upload($params);
     if($form->isSuccessful()){
         $this->file = new Gpf_Io_File($form->getFieldValue("fileurl"));
         $fileSizeArray = explode('.', $this->file->getSize());
         $this->fileSize = $fileSizeArray[0];
         $fileData = $_FILES[self::UPLOAD_NAME];
         $this->originalFile =  basename($fileData['name']);
     }
     return $form;
 }
Exemplo n.º 2
0
 /**
  * Upload file to server
  *
  * @param Gpf_Rpc_Params $params
  * @service db_file write
  * @return Gpf_Rpc_Form
  */
 public function upload(Gpf_Rpc_Params $params)
 {
     $cacheExportDirectory = Gpf_Paths::CACHE_DIRECTORY . Gpf_Csv_ImportExportService::EXPORT_DIRECTORY;
     $this->clearTempDirectory(Gpf_Paths::getInstance()->getAccountDirectoryPath() . $cacheExportDirectory);
     $this->setRelativeUploadPath(Gpf_Paths::getInstance()->getAccountDirectoryRelativePath() . $cacheExportDirectory);
     $form = parent::upload($params);
     $form->setField("filename", Gpf_Paths::getInstance()->getFullAccountServerUrl() . $cacheExportDirectory . $this->getName());
     $form->setField("fileid", Gpf_Paths::getInstance()->getAccountPath() . $cacheExportDirectory . $this->getName());
     $form->setField("filesize", $this->size);
     $form->setField("filetype", $this->type);
     return $form;
 }