S3 Multipart uploads - possible to hook up with liveview?

I am trying to create an upload field for large files (mp4, multiple GB) and need to use the multipart uploads as mentioned here: Uploading and copying objects using multipart upload - Amazon Simple Storage Service

Is this possible to hook up with liveview? I’m fairly new to liveview so need some help pointing me in the right direction. The docs only mention the S3 post method which I can’t us and UpChunk which doesn’t seem to work with S3.

1 Like

External uploads are handled entirely client side, so if it is possible using any framework that is client side (React, Vue, Svelte, vanilla js) it is possible to integrate with LiveView.

This article seems like a good entry point, you can use ExAws.S3 to handle the multipart and generate the presigned urls and try to use the stage 3 code from the article to handle the upload.

Unfortunately it is a purely client side problem and you’ll need to write and debug javascript, so console.log and browser devtools are your friends…

1 Like

How about this elixir ex_aws_s3 example?

I haven’t tried it yet but the only issue I might have is how to get the upload progress?

Take a look at Phoenix LiveView Uploads Deep Dive - Phoenix Blog. It covers uploads in multiple steps. In last step author changes upload method to S3 without any change in template. All you need to do is to adapt this guide to new heex templates if you are using them.