CORS Filepond fileupload
I am at my wits end having spent the entire day on this now. When I upload a file using simple disk command everything works fine:
.env:
My test script which uploads the files without issue (ie the S3 config in my env is fine) - the file appears in my amazon s3 bucket:
THIS WORKS ##
Running the following always gives me a cores issue though:
THIS DOES NOT ##
CORS:
Again - to be super clear, this works without issue with a normal disk->put (IE not a cors configuration issue on S3) and I have tried changing the urls to localhost, 127.0.0.1:8000, you name it I have tried it. Would really appreciate support at this point. Using sail in my demo environment.
Ill also add that during development I added temporary_file_upload=local to config/livewire just to build. Now moving to production and needs fixing
Solution:Jump to solution
For anyone that finds this thread - here is the aws cors config:
```
[
{
"AllowedHeaders": [...
3 Replies
CORS is a client side thing. That's why
$disk->put()
works. You need to configure this on S3 itself.Yea - so GPT just gave me the hidden answer:
❗ Don't use "*" for AllowedOrigins if you're using Authorization headers (which presigned URLs do) — otherwise AWS will silently block CORS.
Solution
For anyone that finds this thread - here is the aws cors config:
If the above does not work, try adding in your url in allowed origins.