Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CarnetApp/CarnetNextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhie <phie@phie.ovh>2021-01-22 01:31:06 +0300
committerPhie <phie@phie.ovh>2021-01-22 01:31:06 +0300
commitaddec2ab878f0c3a64aab368b3145b02346e7aae (patch)
tree50cb272e37b9cfebfba459473edbdfb3d2702474
parent989e13c160bee9076987a2ccf014e098784d3caf (diff)
fix export note folder
-rwxr-xr-xlib/Controller/NoteController.php10
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;