Skip to content

Commit

Permalink
Dev: fixed an issue with path based LimeSurvey
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque authored and eddylackmann committed Jan 10, 2020
1 parent ab0a1df commit d8a5845
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions application/controllers/admin/LimeSurveyFileManager.php
Expand Up @@ -375,15 +375,19 @@ public function downloadFiles() {
$arrayOfFiles = array_map( function($file){ return $file['path']; }, $files);
$archive = new PclZip($zipfile);
$checkFileCreate = $archive->create($arrayOfFiles, PCLZIP_OPT_REMOVE_ALL_PATH);
$urlFormat = Yii::app()->getUrlManager()->getUrlFormat();
$getFileLink = Yii::app()->createUrl('admin/filemanager/sa/getZipFile');
if($urlFormat == 'path') {
$getFileLink .= '?path='.$zipfile;
} else {
$getFileLink .= '&path='.$zipfile;
}

$this->_printJsonResponse(
[
'success' => true,
'message' => sprintf(gT("Files ready for download in archive %s."), $randomizedFileName),
'downloadLink' => Yii::app()->createUrl(
'admin/filemanager/sa/getZipFile',
['path' => $zipfile]
),
'downloadLink' => $getFileLink ,
]
);
}
Expand Down

0 comments on commit d8a5845

Please sign in to comment.