maz

maz

LiveView Upload External/S3 to filebase.com results in External client failure error

anybody have experience with s3.filebase.com instead of s3.amazonaws.com for getting a presigned url with that simple_s3_upload.ex that Chris McCord made? I’m getting a failure with the same settings that works with amazonaws but not filebase.com:

meta: %{
  fields: %{
    "acl" => "public-read",
    "content-type" => "image/jpeg",
    "key" => "input/280ba797-2c40-4d2e-bf64-597208d459c0.jpg",
    "policy" => "ewogICJleHBpcmF0aW9uIjogIjIwMjItMDctMTlUMTc6MzQ6NDUuNjU4OTYyWiIsCiAgImNvbmRpdGlvbnMiOiBbCiAgICB7ImJ1Y2tldCI6ICAiaGFyZHNheWluZ3MtbWFpbiJ9LAogICAgWyJlcSIsICIka2V5IiwgImlucHV0LzI4MGJhNzk3LTJjNDAtNGQyZS1iZjY0LTU5NzIwOGQ0NTljMC5qcGciXSwKICAgIHsiYWNsIjogInB1YmxpYy1yZWFkIn0sCiAgICBbImVxIiwgIiRDb250ZW50LVR5cGUiLCAiaW1hZ2UvanBlZyJdLAogICAgWyJjb250ZW50LWxlbmd0aC1yYW5nZSIsIDAsIDUwMDAwMDAwMF0sCiAgICB7IngtYW16LXNlcnZlci1zaWRlLWVuY3J5cHRpb24iOiAiQUVTMjU2In0sCiAgICB7IngtYW16LWNyZWRlbnRpYWwiOiAiMjFERTc1QTgwNkJDNjkxQzk2RTYvMjAyMjA3MTkvdXMtZWFzdC0xL3MzL2F3czRfcmVxdWVzdCJ9LAogICAgeyJ4LWFtei1hbGdvcml0aG0iOiAiQVdTNC1ITUFDLVNIQTI1NiJ9LAogICAgeyJ4LWFtei1kYXRlIjogIjIwMjIwNzE5VDE3MzQ0NVoifQogIF0KfQo=",
    "x-amz-algorithm" => "AWS4-HMAC-SHA256",
    "x-amz-credential" => "21DE75A806BC691C96E6/20220719/us-east-1/s3/aws4_request",
    "x-amz-date" => "20220719T173445Z",
    "x-amz-server-side-encryption" => "AES256",
    "x-amz-signature" => "347e5a0c7b8e780ef449288102f0f7c341369ceb486863b829052501be3a4a8c"
  },
  key: "input/280ba797-2c40-4d2e-bf64-597208d459c0.jpg",
  uploader: "S3",
  url: "//my-cool-bucket-main.s3.filebase.com"
}

I’ve confirmed the folder input exists
"key" => "input/280ba797-2c40-4d2e-bf64-597208d459c0.jpg",

I also tried re-arranging the bucket to the end of the url so that it renders like this:

url: "//s3.filebase.com/my-cool-bucket-main"

but this returns with “Exteral client failure” still.

This is the simple_s3_uploader.ex I’m using:

Most Liked

mcrumm

mcrumm

Phoenix Core Team

Data transfer for external uploads is 100% userland. The Direct to S3 example in the guides has the complete code for an XHR POST uploader on the client but you could modify it however you’d like. :slight_smile:

Last Post!

bartblast

bartblast

Creator of Hologram

Make sure presigned PUT requests are enabled on the bucket.

Where Next?

Popular in Questions Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
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
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
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
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
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
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New

We're in Beta

About us Mission Statement