I am not sure if I am missing something with my configuration. Though I have tried many different ways.
AWS_ACCESS_KEY_ID=KEY
AWS_SECRET_ACCESS_KEY=KEY
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=BUCKETNAME
AWS_ENDPOINT=https://nyc3.digitaloceanspaces.com
AWS_USE_PATH_STYLE_ENDPOINT=false
AWS_URL=https://BUCKETNAME.nyc3.cdn.digitaloceanspaces.com
This is how it is configured, obviously the keys are set properly and the bucketname is also configured properly. It does attempt to PUT files to the space however they come out like so.
Access to XMLHttpRequest at
from origin ‘https://market.test’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
This made me believe that it was related to the CORS configuration on the bucket. So I went in an added my development address. “https://market.test” and set it to have all allowed methods ( this is just for a development env ) and ACM age to 0s.
This didn’t work so I even added the same with the Origins set to *
Anyone have any ideas on what might be able to resolve this?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there,
Can you also share the configuration in your
config/filesystems.php
?I could suggest adding
'visibility' => 'public'
setting to your filesystem as it will be needed to ensure that the images uploaded via the media manager are visible to the public.Do you also see any errors in the Laravel error log when you try to upload images?
I usually follow step 1 and step 2 from this guide here on how to configure Laravel with Spaces:
Regarding your CORS error, would you mind sharing a screenshot of the current CORS configuration that you have?
- Bobby