mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-08-28 21:22:30 +00:00
set uploaded files public visibliity (relevant for S3 storage)
This commit is contained in:
parent
10418323ef
commit
32a06f119b
@ -95,6 +95,7 @@ class ImageService
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$storage->put($fullPath, $imageData);
|
$storage->put($fullPath, $imageData);
|
||||||
|
$storage->setVisibility($fullPath, 'public');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new ImageUploadException('Image Path ' . $fullPath . ' is not writable by the server.');
|
throw new ImageUploadException('Image Path ' . $fullPath . ' is not writable by the server.');
|
||||||
}
|
}
|
||||||
@ -167,6 +168,7 @@ class ImageService
|
|||||||
|
|
||||||
$thumbData = (string)$thumb->encode();
|
$thumbData = (string)$thumb->encode();
|
||||||
$storage->put($thumbFilePath, $thumbData);
|
$storage->put($thumbFilePath, $thumbData);
|
||||||
|
$storage->setVisibility($thumbFilePath, 'public');
|
||||||
$this->cache->put('images-' . $image->id . '-' . $thumbFilePath, $thumbFilePath, 60 * 72);
|
$this->cache->put('images-' . $image->id . '-' . $thumbFilePath, $thumbFilePath, 60 * 72);
|
||||||
|
|
||||||
return $this->getPublicUrl($thumbFilePath);
|
return $this->getPublicUrl($thumbFilePath);
|
||||||
|
Loading…
Reference in New Issue
Block a user