Difficulty starting with AWS S3 Multipart

I’m struggling to get started with figuring out how to use Uppy to upload to S3 using multipart.

My site is using Laravel and ideally I want to use Laravel Envoy (serverless hosting) which means large uploads must go directly to S3 (some of my uploads are multi GB - will this work or are there issues with such large files?).

I can see that the companion URL is used to provide Uppy with the signed S3 upload URL and to interface somehow with the AWS api to handle the multi-part process, but I’m really struggling with how this lot pieces together.

I’m guessing, in my instance, something on the server side that responds to various calls from the client side? But what are those calls and what does the response look like?

Are there any examples I can browse somewhere that offer some pointers?

Yea, you can use Companion (but probably not on Envoy, since it’s a node app and not well suited for serverless), or implement some HTTP endpoints yourself and point Uppy to those instead. Github user janko described the process in this issue: https://github.com/transloadit/uppy/issues/1189#issuecomment-445521442
You can either implement your endpoints to work with the same API as the Companion endpoints, and then you can do:

uppy.use(AwsS3Multipart, { companionUrl: '/your-server/' })

Or do some custom implementation on the server and override all the functions in the S3 Multipart plugin options: https://uppy.io/docs/aws-s3-multipart/#createMultipartUpload-file

1 Like

OK, thanks.

Unfortunately I’m really struggling with this. I think I need to see some example code to help me understand how to get this working. At the moment, I’m completely lost!

If I understand this correctly, there’s several elements to this.

Uppy needs to exist on the page in the clients browser and it needs to make various callbacks to the backend - firstly to get authority to begin the upload and then various other callbacks during the upload to manage things like progress and presumably to store some details about the parts uploaded.

Once the upload is complete, the aws api needs to be called to stitch this lot back together.

At the moment, I cannot get my head around how these calls are structured on the clientside and I’m unsure what my backend should be providing.

If there are any code examples anywhere that give just the slightest hit of how this might work, that would help.

(Oh and I meant Laravel Vapor - the new laravel serverless environment) not Envoyer. I imagine a lot of people may be looking for a similar solution to me. If not immediately, then soon!

Any help is greatly appreciated.