/** * Download a file. * @param $fileId int the file id of the file to download * @param $inline print file as inline instead of attachment, optional * @return boolean */ function downloadFile($fileId, $userId, $inline = false) { $temporaryFile =& $this->getFile($fileId, $userId); if (isset($temporaryFile)) { $filePath = $this->getBasePath() . $temporaryFile->getServerFileName(); return parent::downloadFile($filePath, null, $inline); } else { return false; } }
/** * Download execution log file. * @param $file string */ function downloadExecutionLog($file) { import('lib.pkp.classes.file.PrivateFileManager'); $fileMgr = new PrivateFileManager(); $fileMgr->downloadFile($fileMgr->getBasePath() . DIRECTORY_SEPARATOR . SCHEDULED_TASK_EXECUTION_LOG_DIR . DIRECTORY_SEPARATOR . $file); }