From: Younes El Biache Date: Sat, 9 Jul 2016 13:26:53 +0000 (+0200) Subject: set uploaded files public visibliity (relevant for S3 storage) X-Git-Tag: v0.12.0~1^2~22^2 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/refs/pull/144/head?ds=sidebyside set uploaded files public visibliity (relevant for S3 storage) --- diff --git a/app/Services/ImageService.php b/app/Services/ImageService.php index dd965c90f..274172f0f 100644 --- a/app/Services/ImageService.php +++ b/app/Services/ImageService.php @@ -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 +}