From f9832f0a3f67d7c0664333c6a1c9ef2799752637 Mon Sep 17 00:00:00 2001 From: Louis Jeckel Date: Mon, 7 Sep 2020 14:48:40 +0200 Subject: [PATCH] disable base64 encode --- app/PdfFile.php | 10 +++++----- resources/views/flowpaper/view.blade.php | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/PdfFile.php b/app/PdfFile.php index 18fdea0..ac9c4a7 100644 --- a/app/PdfFile.php +++ b/app/PdfFile.php @@ -238,7 +238,7 @@ class PdfFile extends TwillModel implements Sortable */ public function getBinPathAttribute(): string { - return "$this->directory/data.bin"; + return "$this->directory/file.bin"; } /** @@ -436,10 +436,10 @@ class PdfFile extends TwillModel implements Sortable */ public function saveToCloud() { - $binPath = sys_get_temp_dir().'/'.uniqid('bin_', false); - file_put_contents($binPath, base64_encode($this->getPdf())); - Storage::cloud()->putFileAs('/', $binPath, $this->binPath); - unlink($binPath); +// $binPath = sys_get_temp_dir().'/'.uniqid('bin_', false); +// file_put_contents($binPath, base64_encode($this->getPdf())); + Storage::cloud()->putFileAs('/', $this->absolutePdfPath, $this->binPath); +// unlink($binPath); } diff --git a/resources/views/flowpaper/view.blade.php b/resources/views/flowpaper/view.blade.php index cc18786..d273880 100644 --- a/resources/views/flowpaper/view.blade.php +++ b/resources/views/flowpaper/view.blade.php @@ -39,14 +39,14 @@ - $.get(url) - .then(function(d) { + // $.get(url) + // .then(function(d) { $('#documentViewer').FlowPaperViewer( { config: { - PDFFile: "data:application/octet-stream;base64,"+d, + PDFFile: url, Scale: 0.6, ZoomTransition: 'easeOut', ZoomTime: 0.5, @@ -83,7 +83,6 @@ } } ); - }) } -- 2.39.5