Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def upload(photos) do
ext = Path.extname(upload.filename)
u = Ecto.UUID.generate
flnm = "#{u}#{ext}"
{:ok, file_binary} = File.read(upload.path)
s3_bucket = "imagey-elixir"
{:ok, _} =
ExAws.S3.put_object(s3_bucket, flnm, file_binary)
|> ExAws.request()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.