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