]> BookStack Code Mirror - bookstack/commitdiff
set uploaded files public visibliity (relevant for S3 storage) 144/head
authorYounes El Biache <redacted>
Sat, 9 Jul 2016 13:26:53 +0000 (15:26 +0200)
committerGitHub <redacted>
Sat, 9 Jul 2016 13:26:53 +0000 (15:26 +0200)
app/Services/ImageService.php

index dd965c90fb449368f92a787d5f9b58d2eedf609d..274172f0fa0b831bfdb7023ea938697850a82021 100644 (file)
@@ -95,6 +95,7 @@ class ImageService
 
         try {
             $storage->put($fullPath, $imageData);
+            $storage->setVisibility($fullPath, 'public');
         } catch (Exception $e) {
             throw new ImageUploadException('Image Path ' . $fullPath . ' is not writable by the server.');
         }
@@ -167,6 +168,7 @@ class ImageService
 
         $thumbData = (string)$thumb->encode();
         $storage->put($thumbFilePath, $thumbData);
+        $storage->setVisibility($thumbFilePath, 'public');
         $this->cache->put('images-' . $image->id . '-' . $thumbFilePath, $thumbFilePath, 60 * 72);
 
         return $this->getPublicUrl($thumbFilePath);
@@ -269,4 +271,4 @@ class ImageService
     }
 
 
-}
\ No newline at end of file
+}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.