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

Don't set public visibility when uploading files. #982

Merged
merged 1 commit into from Sep 11, 2020

Conversation

abishekrsrikaanth
Copy link
Contributor

When using filesystem drives like S3, GCS or DO Spaces, it is recommended that the file is not set to public visibility.
This should be driven by what is setup on laravel's filesystem configuration.

When a S3 bucket doesn't have public visibility, uploading a file with public visibility will throw the following error

Aws\S3\Exception\S3Exception' with message 'Error executing "PutObject" on {S3 URL} ; AWS HTTP error: Client error: `PUT {S3 URL}` resulted in a `403 Forbidden`

Don't set public visibility if the storage doesn't support it
@khaledelmahdi
Copy link

How to restore this feature in my code? I want all the files I upload to S3 to be public.

Thank you.

@mafftor
Copy link
Contributor

mafftor commented Jan 6, 2021

@khaledelmahdi go to config/filesystems.php
and set:

'disks' => [
        's3' => [
            .....
            .....
            'visibility' => 'public',
        ],
    ],

It might help you 👍 Waiting for your feedback

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

Successfully merging this pull request may close these issues.

None yet

4 participants