Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
def create(conn, %{"photo" => %{"image" => image_params} = photo_params}) do
album_id = photo_params["album_id"]
ExAws.S3.put_bucket("#{album_id}", "")
|> ExAws.request(), fn(img) ->
album = album_id
ext = Path.extname(img.filename)
u = Ecto.UUID.generate
flnm = "#{u}#{ext}"
{:ok, file_binary} =
s3_bucket = album
{:ok, _} =
ExAws.S3.put_object(s3_bucket, flnm, file_binary)
|> ExAws.request()
store(conn, flnm, album)
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.