romenigld

romenigld

S3 AMAZON error has been blocked by CORS policy

hello Guys,
I am trying to upload a photo on S3 Amazon by the course LiveView of the PragProg.
And I am having some errors.
on the application tells it complains for:
“External client failure”.

And on my console it complains for:


Access to XMLHttpRequest at 'https://<mybucket>.s3.amazonaws.com/' (redirected from 'http://<mybucket>.s3.amazonaws.com/') from origin 'http://www.localhost:4000' 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.

and other error:

uploaders.js:21 POST https://<mybucket>.s3.amazonaws.com/ net::ERR_FAILED

In my configuration CORS I put:

[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET",
            "PUT",
            "POST",
            "DELETE",
            "HEAD"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": []
    }
]

I am trying to change the configuration on permissions but it’s not working.
Can anyone help me with this, please?

First Post!

romenigld

romenigld

I edited again the configuration CORS with the same values and now it is working.
Maybe it was needed some time for work.
I don’t now, but it’s working now.
I want now If someone knows a place(tutorial or book) for the case to use the S3 for production.
Like this things I don’t know like the List of the control access and ACLs?

Last Post!

romenigld

romenigld

on the course you can see on the Chapter: 34. File Uploads - Notes.
It has the links:

Where Next?

Popular in Questions Top

hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" =&gt; #BSON.ObjectId&lt;58eb1a7a9ad169198c3dXXXX&gt;, "email" =&gt; ...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
Lily
In templates/appointment/index.html.eex: &lt;%= for appointment &lt;- @appointments do %&gt; &lt;tr&gt; &lt;td&gt;&lt;%= appoi...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 54921 245
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49084 226
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID&lt;0.412.0&gt; terminating ** (Postgrex.Error) FATAL...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement