Exemplo n.º 1
0
    protected function saveUploadedFile() {
        $file = parent::saveUploadedFile();

        $file = str_replace('../' . Gpf_Paths::getInstance()->getAccountDirectoryRelativePath(), 
                            Gpf_Paths::getInstance()->getFullAccountServerUrl(),                        
                            $file);

        return $file;
    }
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;
 }
Exemplo n.º 3
0
 protected function generateFileName($count){
     return parent::generateFileName($count). self::TMP_EXT;
 }
Exemplo n.º 4
0
 public function __construct()
 {
     parent::__construct();
     $this->setAllowedFileExtensions(array('ico'));
     $this->setRelativeUploadPath(Gpf_Paths::getInstance()->getAccountDirectoryRelativePath() . Gpf_Paths::FILES_DIRECTORY);
 }
Exemplo n.º 5
0
 public function __construct() {
     parent::__construct();
     $this->setAllowedFileExtensions(array('zip'));
 }