papakay
Bucket name is added to the storage path in digitaolcean space
Please i’m having issue with the file uploaded on the digitalocean space. The bucket bucket name is included in the key of the file stored.
ex_aws 2.0
ex_aws 2.0
Please see a sample response
{:ok, %{ body: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><CompleteMultipartUploadResult xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\"><Location>afribary-test.ams3.digitaloceanspaces.com</Location><Bucket>afribary-test</Bucket><Key>afribary-test/enterprise/spentary/logo-spentary-1526017375612733000.jpg</Key><ETag>32458d84455d0feda12a654fd41cff3a-1</ETag></CompleteMultipartUploadResult>", headers: [ {"x-amz-request-id", "tx00000000000000100a6d8-005af52d63-4b4052-ams3a"}, {"Content-Type", "application/xml"}, {"Content-Length", "370"}, {"Date", "Fri, 11 May 2018 05:42:59 GMT"}, {"Strict-Transport-Security", "max-age=15552000; includeSubDomains; preload"} ], status_code: 200 }}
I want to be able to access the file without /bucket-name:
https://afribary-test.ams3.digitaloceanspaces.com/enterprise/spentary/logo-spentary-1526016173276296000.png
but i got this
https://afribary-test.ams3.digitaloceanspaces.com/afribary-test/enterprise/spentary/logo-spentary-1526016173276296000.png
def upload(filename, space_path_without_bucket_name) do
filename
|> ExAws.S3.Upload.stream_file()
|> ExAws.S3.upload(@bucket, space_path_without_bucket_name)
|> ExAws.request()
end
Marked As Solved
benwilson512
Ah on the github issue you have:
host: "afribary-test.ams3.digitaloceanspaces.com",
Don’t include the bucket in the hostname, instead do host: "ams3.digitaloceanspaces.com",
Also Liked
papakay
The document states that DigitalOcean Spaces is AWS Compatible. A colleague was able to upload to the object store successfully without this issue using the php/laravel sdk.
So i’m wondering why this happening with elixir sdk.
papakay
Awesome! Thank you so much.
This solved it! I’m so grateful!
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









