/** * Download cached csv language file * * @service language export * @param Gpf_Rpc_Params $params */ public function downloadCsvLanguage(Gpf_Rpc_Params $params) { $form = new Gpf_Rpc_Form($params); $download = new Gpf_File_Download_FileSystem(Gpf_Lang_CsvLanguage::getAccountCsvFileName($form->getFieldValue('code'))); $download->setAttachment(true); return $download; }
/** * Download export csv file * * @service export_file export * @param Gpf_Rpc_Params $params */ public function downloadFile(Gpf_Rpc_Params $params) { $form = new Gpf_Rpc_Form($params); try { $export = new Gpf_Db_Export(); $export->setPrimaryKeyValue($form->getFieldValue("exportId")); $export->load(); $fileName = $export->getFileName(); } catch (Gpf_Exception $e) { $fileName = ' '; } $filePath = Gpf_Paths::getInstance()->getAccountDirectoryPath() . Gpf_Csv_ImportExportService::EXPORT_DIRECTORY . $fileName; $download = new Gpf_File_Download_FileSystem($filePath); $download->setAttachment(true); return $download; }
/** * * @service banner read * @param $fields */ public function download(Gpf_Rpc_Params $params){ $form = new Gpf_Rpc_Form($params); $fileid = $form->getFieldValue('fileid'); $affiliateid = $form->getFieldValue('affiliateid'); $bannerid = $form->getFieldValue('bannerid'); $filetypes = $form->getFieldValue('filetypes'); $affiliate = $this->loadAffiliate($affiliateid); $banner = $this->loadBanner($bannerid); try { $channelcode = $form->getFieldValue('channelcode'); $banner->setChannel(Pap_Db_Channel::loadFromId($channelcode, $affiliate->getId())); } catch (Gpf_Exception $e) { $channelcode = null; } $unpackedZipFolderPath = $this->getZipFolderUrl() . $fileid; $cacheZipFolderPath = $this->getCahcheFolderUrl() . $bannerid . '_' . $affiliateid . '_' . $fileid; $this->copyFilesToCacheZipFolder($unpackedZipFolderPath, $cacheZipFolderPath); $this->replaceTemplatesInDirectory($cacheZipFolderPath, $filetypes, $affiliate, $banner, $channelcode); $archiveName = $this->packBanner($this->getCahcheFolderUrl(),$cacheZipFolderPath , $affiliate, $this->getFileName($fileid)); $download = new Gpf_File_Download_FileSystem($archiveName); $download->setAttachment(true); return $download; }
/** * Download API file from server * @service * @anonym * @param Gpf_Rpc_Params $params */ public function download(Gpf_Rpc_Params $params) { $file = new Gpf_File_Download_FileSystem(self::API_BASE_PATH . Gpf_Application::getInstance()->getApiFileName()); $file->setAttachment(true); return $file; }