By Tristan
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!
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:
https://devdojo.com/bobbyiliev/how-to-use-digitalocean-spaces-with-laravel-voyager
Regarding your CORS error, would you mind sharing a screenshot of the current CORS configuration that you have?
- Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.