Skip to content

Commit 3529aa4

Browse files
tomassalazarlopezstreamtw
authored andcommitted
Update save method in LfmStorageRepository.php
Add extra lines of code to upload images to s3 with public permissions and with the original name, because actually uploads with a folder renamed with the original name of the image and inside image with aleatory name and without permissions to read
1 parent ac04bd7 commit 3529aa4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/LfmStorageRepository.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ public function move($new_lfm_path)
3636

3737
public function save($file)
3838
{
39-
$this->disk->put($this->path, file_get_contents($file));
39+
$nameint = strripos($this->path, "/");
40+
$nameclean = substr($this->path, $nameint + 1);
41+
$pathclean = substr_replace($this->path, "", $nameint);
42+
$this->disk->putFileAs($pathclean, $file_content, $nameclean, 'public');
4043
}
4144

4245
public function url($path)

0 commit comments

Comments
 (0)