]> _ Git - psq.git/commitdiff
disable base64 encode
authorLouis Jeckel <louis.jeckel@outlook.cm>
Mon, 7 Sep 2020 12:48:40 +0000 (14:48 +0200)
committerLouis Jeckel <louis.jeckel@outlook.cm>
Mon, 7 Sep 2020 12:48:40 +0000 (14:48 +0200)
app/PdfFile.php
resources/views/flowpaper/view.blade.php

index 18fdea081fc981b4cb2c55ac164575322de3034d..ac9c4a7fe892bfe9393540b083dccc9ce77e360c 100644 (file)
@@ -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);
     }
 
 
index cc187869516182b7a6df73fcd45fbfecd6c48f63..d27388070fba0a8a21501c8e344cd85a689e5c31 100644 (file)
 
 
 
-            $.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 @@
                             }
                         }
                     );
-                })
         }