ex-aws / ex_aws

A flexible, easy to use set of clients AWS APIs for Elixir

Home Page:https://hex.pm/packages/ex_aws

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to implement Chunked HTTP Uploads using ex_aws_s3 and UpChunk for AWS S3 Bucket

patrickespake opened this issue · comments

Hi guys,

I am trying to implement chunked http uploads using ex_aws_s3 and UpChunk.

I am following the documentation: https://hexdocs.pm/phoenix_live_view/uploads-external.html#chunked-http-uploads

But I don’t know how to configure the method presign_upload to generate the aws s3 link with the upload id using ex_aws_s3:

defp presign_upload(entry, socket) do
  {:ok, %{"Location" => link}} =
    SomeTube.start_session(%{
      "uploadType" => "resumable",
      "x-upload-content-length" => entry.client_size
    })

  {:ok, %{uploader: "UpChunk", entrypoint: link}, socket}
end

How can i generate the link to the entrypoint for uploading large files using ex_aws_s3 working with UpChunk?

I tried to find it on Google and in the ex_aws_s3 documentation but it is not clear in the documentation.

Thank you for the help.