I'm working with S3 files with Laravel.
My S3 has no public access, but Laravel is configured with a AWS User that has admin rights on S3.
So, I can upload a file in S3 with no problem.
My issue comes from getting file from there.
If I use:
Storage::disk('s3')->url($this->path);
I will generate a link with format:
https://bucket.s3.region.amazonaws.com/path/filename.pdf
But as public access is not allowed on S3, it will give me
Access Denied
If I use
Storage::disk('s3')->get($this->path);
I can download the data from file, but don't know what to do with it.
EDIT: It seams that doing:
Storage::disk('local')->put(
'filename.txt',
Storage::disk('s3')->get('cloud-filename.txt'));
Will copy the S3 file in storage folder. Now, how should I generate a working link ?