diff options
author | Phie <phie@phie.ovh> | 2021-01-22 01:31:06 +0300 |
---|---|---|
committer | Phie <phie@phie.ovh> | 2021-01-22 01:31:06 +0300 |
commit | addec2ab878f0c3a64aab368b3145b02346e7aae (patch) | |
tree | 50cb272e37b9cfebfba459473edbdfb3d2702474 | |
parent | 989e13c160bee9076987a2ccf014e098784d3caf (diff) |
fix export note folder
-rwxr-xr-x | lib/Controller/NoteController.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Controller/NoteController.php b/lib/Controller/NoteController.php index be4a6e1..b3d8bb8 100755 --- a/lib/Controller/NoteController.php +++ b/lib/Controller/NoteController.php @@ -1623,7 +1623,15 @@ public function getOpusEncoder(){ */ public function getNote($path){ $f = $this->CarnetFolder->get($path); - $r = new DataDisplayResponse($f->getContent()); + if($f->getFileInfo()->getType() === "dir" ){ + $zipFile = new MyZipFile(); + $res = $this->addFolderContentToArchive($f,$zipFile,""); + $r = new DataDisplayResponse($zipFile->outputAsString()); + } + else { + $r = new DataDisplayResponse($f->getContent()); + } + $r->addHeader("Content-Disposition", "attachment; filename=\"".$f->getName()."\""); $r->addHeader("Content-Type", $f->getMimeType()); return $r; |