Upload Files to Amazon S3

This section explains how to create a custom Lightning Web Component (LWC) that uploads the files directly from Salesforce to an Amazon S3 bucket.

Prerequisites

Set up an external data source for Amazon S3 bucket in Salesforce org. SeeS3 External Data Source Setup Guide.

Overview

The Bring Your Own Blob (BYOB) architecture offloads the storage and processing of files from Salesforce servers to Amazon S3 servers. By using a client-side LWC approach, files are uploaded directly from the browser to Amazon S3.

How It Works

The upload process includes three primary stages:

  • Initialize Upload: Retrieve Amazon S3 upload parameters and signed URLs from Salesforce.
  • File Upload Process: Transfer the file content directly from the browser to Amazon S3.
  • Complete Upload: Notify Salesforce to create a ContentDocument record that links to the S3 file.