Skip to main content
Module

x/aws_api/extras/s3-upload.ts>managedUpload

From-scratch Typescript client for accessing AWS APIs
Extremely Popular
Go to Latest
function managedUpload
import { managedUpload } from "https://deno.land/x/aws_api@v0.8.0/extras/s3-upload.ts";

Uploads a Uint8Array stream of unknown size to an Amazon S3 endpoint.

The stream is buffered into chunks of fixed size (partSize, 5MB by default). The chunks are uploaded as a new S3 Multi-part Upload and then finalized. Multiple chunks can upload at the same time (queueSize, 4 by default). This can result in faster uploads for larger files, compared to a single request.

Objects smaller than 5MB skip the multi-part logic entirely and use putObject instead.

Note that multi-part uploads require different IAM permissions than simple uploads. Consider testing your application with files both above and below 5MB.

Parameters

s3: S3Subset
params: CreateMultipartUploadRequest & { Body: ReadableStream<Uint8Array>; }
optional
config: { queueSize?: number; partSize?: number; leavePartsOnError?: boolean; }