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
path: root/lib
diff options
context:
space:
mode:
authorPhie <phie@phie.ovh>2018-09-02 00:47:53 +0300
committerPhie <phie@phie.ovh>2018-09-02 00:47:53 +0300
commit2cb9f1dfcb2a61cd16616c703c1621dbadcf3647 (patch)
treeeb3b50673bceea552f63d9cdc81d5b76e1d309bb /lib
parente309e17a6a44d070a53ad487ba4bb220753bea17 (diff)
wordaround to fix bad size on nextcloud
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Controller/NoteController.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Controller/NoteController.php b/lib/Controller/NoteController.php
index a3931c4..3676367 100755
--- a/lib/Controller/NoteController.php
+++ b/lib/Controller/NoteController.php
@@ -375,7 +375,13 @@
} catch(\OCP\Files\NotFoundException $e) {
}
$file = $this->CarnetFolder->newFile($path);
- $zipFile->saveAsStream($file->fopen("w"));
+ //tried to do with a direct fopen on $file but lead to bad size on nextcloud
+ $tmppath = getcwd()."/".uniqid().".sqd";
+ $zipFile->saveAsFile($tmppath);
+ $tmph = fopen($tmppath, "r");
+ $file->putContent($tmph);
+ fclose($tmph);
+ unlink($tmppath);
}
private function addFolderContentToArchive($folder, $archive, $relativePath){