Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

temporaryUrl() support for private S3 buckets #74

Open
frtess opened this issue Feb 22, 2024 · 0 comments
Open

temporaryUrl() support for private S3 buckets #74

frtess opened this issue Feb 22, 2024 · 0 comments

Comments

@frtess
Copy link

frtess commented Feb 22, 2024

Hi, I was able to get a private bucket working with your package for uploads and deletes, but we can't see the images in the media hub library. From what I can see we would have to use s3's temporaryUrl() function on an object like:

Storage::disk('s3')->temporaryUrl($file_name, '+2 minutes')

Would this be possible to implement ? I think it's going to be more and more necessary, as aws are pushing hard for private buckets these days. (That sounds weird to say, right ? lol)

BTW, if someone has trouble with the "The bucket does not allow ACLs" error, for private buckets, you can fix this globally on the disk by removing the ACLs (the "options" bit):

        's3' => [
            'driver' => 's3',
            'key' => env('AWS_ACCESS_KEY_ID'),
            'secret' => env('AWS_SECRET_ACCESS_KEY'),
            'region' => env('AWS_DEFAULT_REGION'),
            'bucket' => env('AWS_BUCKET'),
            'url' => env('AWS_URL'),
            'endpoint' => env('AWS_ENDPOINT'),
            'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
            'throw' => true,
            'visibility' => 'private', 
            'options' => [
                'ACL' => '' // NEEDED so S3 doesn't throw an error that AccessControlListNotSupported
            ]
        ],

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant