Salesforce File Upload: 5 Ways to Add Files to Records

July 15, 2026
9 minutes

There is no single Salesforce file-upload method for every use case. An agent adding a screenshot to a Case needs a different experience from a developer building a portal, an integration sending documents through an API, or an administrator migrating thousands of files.

For most new solutions, Salesforce stores uploaded files through the Salesforce Files data model: ContentDocument, ContentVersion, and ContentDocumentLink.

This guide covers five practical ways to upload files to Salesforce records and explains when each method is the right choice.

Quick answer: Use the Files related list for ordinary agent uploads, a Flow File Upload component for guided processes, lightning-file-upload for a custom Lightning interface, a supported API for integrations, and Data Loader for bulk migration. For recurring customer screen recordings, consider a video-request integration instead of treating every recording as a generic file.

1. Before you upload: understand the Salesforce Files model

A modern Salesforce File normally involves three records:

  • ContentDocument: the logical file
  • ContentVersion: a specific uploaded version and its binary content
  • ContentDocumentLink: the relationship between the file and a Case, Account, Opportunity, user, group, or library

When a user uploads a new file to a record, Salesforce handles this model behind the scenes.

When you build an API integration or migration, you often work with these objects directly.

Legacy Attachment records use a different data model. If your Salesforce organization contains older Attachments, review the Salesforce Attachment Object vs. Files guide before designing queries or planning a migration.

2. Method 1: upload through the Files related list

This is the simplest method for internal Salesforce users.

Best for

  • Agents adding screenshots or documents to Cases
  • Sales users attaching proposals or supporting material
  • Operations teams adding evidence to a record
  • Occasional manual uploads

How it works

  1. Open the Salesforce record.
  2. Find the Files related list or file component.
  3. Select Upload Files.
  4. Choose or drag the file.
  5. Confirm that the file appears on the record.

If the Files related list is missing, a Salesforce administrator can add it to the page layout or Lightning page.

Advantages

  • No code required
  • Familiar Lightning interface
  • File preview and versioning
  • File remains connected to the Salesforce record
  • Suitable for everyday agent work

Considerations

  • Users need the correct record and file permissions.
  • Record pages can become cluttered when many files accumulate.
  • External-user visibility must be configured and tested separately.
  • A generic file list may not provide the ideal playback, transcript, or review experience for video.

Files are only one part of an effective support workflow. Our Salesforce Case Management guide explains how evidence, communication, ownership, escalation, and resolution work together across the Case lifecycle.

3. Method 2: upload files in a Salesforce Flow

The Flow File Upload screen component lets an administrator add file collection to a guided process.

Best for

  • Case intake or triage flows
  • Internal request forms
  • Guided onboarding
  • Service workflows that require files before a record can advance
  • Low-code implementations

Typical setup

  1. Create or open a Screen Flow.
  2. Add the File Upload input component to a screen.
  3. Provide the related record ID when the file should be connected to an existing record.
  4. Configure accepted file types.
  5. Decide whether multiple files are allowed.
  6. Use the component’s output values in later Flow steps when needed.
  7. Test the Flow with the exact user profiles that will run it.

Salesforce documents an organization limit of up to 25 files uploaded at the same time for this component and a maximum file size of 2 GB.

Experience Cloud moderation and site settings can impose additional limits.

Public and unauthenticated uploads require a different security model from internal or authenticated uploads. See our guide to allowing guest users to upload files in Salesforce safely.

Create the record first or later?

If a file must be related to a new Case, it is often easier to:

  1. Collect the initial Case information.
  2. Create the Case.
  3. Store the new Case ID.
  4. Present a file-upload step associated with that ID.

A more complex design can stage the file before record creation, but it requires careful handling of:

  • File ownership
  • Private files
  • Cleanup
  • Error recovery
  • Failed record creation

Advantages

  • Low-code and guided
  • Can combine upload with validation and branching
  • Useful for standardized internal processes
  • Can return ContentDocument IDs and uploaded file names for authenticated users

Considerations

  • Guest-user behavior differs from authenticated-user behavior.
  • Flow running context and permissions require review.
  • Large files can create a slow or confusing form experience.
  • For screen recordings, a dedicated recording link may be easier than asking the customer to create and upload a video file.

4. Method 3: use the lightning-file-upload component

Developers can use the lightning-file-upload Lightning Web Component to add a native upload experience to Lightning Experience, the Salesforce mobile app, or supported Experience Builder sites.

Best for

  • Custom Lightning record pages
  • Tailored agent consoles
  • Authenticated Experience Cloud experiences
  • Interfaces requiring upload events and custom follow-up logic

Basic LWC example

<template>
   <lightning-file-upload
       label="Upload supporting files"
       name="caseFiles"
       accept={acceptedFormats}
       record-id={recordId}
       multiple
       onuploadfinished={handleUploadFinished}>
   </lightning-file-upload>
</template>
import { LightningElement, api } from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';

export default class CaseFileUpload extends LightningElement {
   @api recordId;

   get acceptedFormats() {
       return ['.pdf', '.png', '.jpg', '.txt'];
   }

   handleUploadFinished(event) {
       const uploadedFiles = event.detail.files;

       this.dispatchEvent(
           new ShowToastEvent({
               title: 'Upload complete',
               message: `${uploadedFiles.length} file(s) uploaded`,
               variant: 'success'
           })
       );
   }
}

For authenticated users, record-id associates the uploaded file with the Salesforce record.

If no record ID is provided, the file can remain private to the uploading user.

Salesforce’s component documentation states that the standard component can upload files up to 10 GB, with a configurable simultaneous-upload limit from 1 to 25 files.

Experience Builder site limits can be lower, and mobile or file-security restrictions may also apply.

Advantages

  • Native Salesforce user experience
  • Drag-and-drop support
  • Accepted-format filtering
  • Upload completion event
  • Easy record association for authenticated users

Considerations

  • Guest users require a different architecture.
  • The accept attribute improves the user experience but is not a complete security control.
  • Server-side validation can still reject an upload.
  • Validation rules or required custom fields on ContentVersion can affect the component.
  • Android and other platform-specific limitations should be tested.

5. Method 4: upload through an API

Use an API when an external application, middleware process, mobile app, or backend service must send a file to Salesforce.

Best for

  • Product-generated evidence
  • Document integrations
  • Automated Case creation
  • External support portals
  • System-to-system workflows

Salesforce provides several API paths for file upload, including:

  • User Interface API
  • REST-based sObject operations
  • Connect REST API
  • Other supported Salesforce platform interfaces

The right choice depends on the application, file size, authentication model, and required behavior.

Common Files creation pattern

For a new file:

  1. Create a ContentVersion with the file data.
  2. Use FirstPublishLocationId to associate the first version with a record, or retrieve the resulting ContentDocumentId.
  3. Create additional ContentDocumentLink records when the same file must be connected to more records.

A simplified Apex equivalent looks like this:

ContentVersion cv = new ContentVersion(
   Title = 'Error screenshot',
   PathOnClient = 'error-screenshot.png',
   VersionData = imageBlob,
   FirstPublishLocationId = caseId
);

insert cv;

For a REST integration, use the official multipart upload format and OAuth authentication.

Do not place large files into ordinary JSON payloads unless the chosen API explicitly requires and supports that representation.

API security checklist

  • Use OAuth and a dedicated integration identity.
  • Grant the minimum required object, field, and record access.
  • Validate file type, size, and business context before upload.
  • Protect against replay and duplicate submissions.
  • Log file IDs and related record IDs.
  • Handle partial failure and retry operations idempotently.
  • Do not expose Salesforce record IDs to unauthenticated users without an approved access-control pattern.
  • Confirm data residency, retention, and deletion behavior.

6. Method 5: bulk upload with Data Loader

Data Loader is appropriate when you need to upload or migrate many files rather than provide an interactive end-user experience.

Best for

  • Legacy document migration
  • Initial data loads
  • Moving Attachments to Salesforce Files
  • Loading generated documents in bulk
  • Administrative remediation

A typical Data Loader process uses a CSV for ContentVersion with columns such as:

Title,PathOnClient,VersionData,FirstPublishLocationId
Installation Guide,C:\files\installation-guide.pdf,C:\files\installation-guide.pdf,500XXXXXXXXXXXX

VersionData points to the local file path.

FirstPublishLocationId can relate the newly created Salesforce File to the target record.

For more complex migrations, you may need to:

  1. Insert ContentVersion records.
  2. Export the resulting IDs and ContentDocumentId values.
  3. Insert ContentDocumentLink records for additional relationships.
  4. Validate record counts, access, and sample downloads.

Before migrating historical records, make sure you understand the differences between legacy Attachments and modern Salesforce Files. Our Salesforce Attachment Object vs. Files guide covers the data model, migration logic, and access implications.

Advantages

  • Designed for administrative bulk work
  • Repeatable with controlled CSV inputs
  • Better suited to large migrations than manual upload
  • Can associate files with records during creation

Considerations

  • File paths must be accessible from the Data Loader machine.
  • CSV encoding and path escaping require attention.
  • Audit-field preservation may require a supported migration process.
  • A successful import job does not prove that users can access the files.
  • Always test with representative permissions and external-user scenarios.

7. Which Salesforce file-upload method should you use?

Scenario Recommended Method
An agent adds a screenshot to a Case Files related list
An administrator builds a guided intake process Flow File Upload component
A developer builds a custom Lightning interface lightning-file-upload
An external service creates files automatically Supported Salesforce API
Thousands of historical documents must be migrated Data Loader or a governed migration tool
An unauthenticated customer must show a software issue Secure video request or carefully designed guest upload
A customer uploads a standard PDF through a portal Authenticated portal upload or a secured guest-upload architecture

8. Uploading files to a Salesforce Case

The correct approach for a Salesforce Case depends on who provides the file.

Internal agent

Use the Files related list, a quick action, or a custom component.

Keep the file name descriptive.

Examples:

  • checkout-error-screenshot-2026-07-14.png
  • customer-log-redacted.txt
  • configuration-export.json

Files often support the conversation around a Case, but they do not replace clear customer communication. Our guide to Salesforce Case Comments explains how public and private comments should be used alongside supporting evidence.

Authenticated customer

Use an Experience Cloud component or Flow with record access and file visibility configured for the customer’s profile and sharing model.

Unauthenticated customer

Do not simply expose a Salesforce Case ID and assume guest upload will be secure.

Salesforce’s guest-user model requires deliberate configuration and often a custom association pattern. Read the guest upload guide.

Customer video

A video is technically a file, but support teams often need more than storage.

They may also need:

  • Easy recording
  • Secure sharing
  • Browser playback
  • Captions
  • AI summaries
  • A clear connection to the Case
  • Retention and access controls

With Videolink, an agent can request a recording from the Salesforce Case workflow.

The customer opens a link, records their screen or camera, and returns the visual context without first creating and locating a video file to upload.

This workflow is especially useful for:

  • Bug reproduction
  • Configuration problems
  • Visual defects
  • Hardware or equipment issues
  • Onboarding blockers
  • Intermittent behavior

Video capture is one part of the wider Salesforce service stack. See our overview of Salesforce customer support software for tools covering visual evidence, telephony, automation, knowledge management, and reporting.

9. Salesforce file-upload best practices

Restrict only what you can enforce

Use interface filters for convenience and server-side validation for security.

File extensions and MIME types alone are not sufficient proof of file content.

Keep filenames meaningful

Generic names such as image1.png or video.mp4 are difficult to use later.

Add enough context to identify the file without placing sensitive customer data in the filename.

Define retention and ownership

Decide:

  • Who owns uploaded files
  • How long files are retained
  • What happens when a Case is deleted
  • What happens when a record is archived
  • How files are handled when customer data is anonymized

Separate customer visibility from internal visibility

A file associated with a Case is not automatically appropriate for every person who can access the Case.

Review ContentDocumentLink visibility and Experience Cloud behavior.

Monitor storage

Files can grow quickly, especially:

  • Logs
  • Data exports
  • Images
  • Video recordings
  • Large documents

Track storage consumption and decide when external or specialized storage is more appropriate.

Design for failed uploads

Show a clear error, preserve the user’s form input, and provide a retry path.

For integrations, use idempotency and durable logging to avoid duplicate files.

Make uploaded evidence accessible

Use descriptive filenames.

For video, provide captions or transcripts where possible.

Ensure users can review the evidence without downloading unsupported formats.

10. Frequently asked questions

How do I upload a file to a Salesforce record?

For a manual upload, open the Salesforce record and use its Files related list or upload component.

For automation, use Flow, lightning-file-upload, a supported API, or Data Loader.

Which object stores files in Salesforce?

Modern Salesforce Files use ContentDocument, ContentVersion, and ContentDocumentLink.

Historical files may be stored as legacy Attachment records.

How do I attach a file to a Case through the API?

Create a ContentVersion and set FirstPublishLocationId to the Salesforce Case ID.

Alternatively, create a ContentDocumentLink after the file has been created.

Use the official Salesforce API format for binary uploads.

Can guest users upload files?

Yes, but guest uploads are disabled by default and require:

  • Specific organization settings
  • A secure file-association pattern
  • Careful access controls
  • Thorough external-user testing

Do not treat guest upload as a checkbox-only implementation.

Can Salesforce upload video files?

Salesforce Files can store supported video files within the applicable limits.

For customer support, a dedicated video workflow may provide easier recording, playback, captions, summaries, and sharing.

What is the maximum Salesforce file size?

The maximum depends on the upload method and context.

For example, Salesforce currently documents file uploads of up to 10 GB for lightning-file-upload, while Flow and Experience Cloud contexts can have lower limits.

Check the latest Salesforce documentation and your organization settings before designing around a specific limit.

Sources and further reading

Salesforce Developers, File Upload Lightning Component

Salesforce, Flow File Upload Screen Component

Salesforce Developers, Upload Files with User Interface API

Salesforce Developers, Upload Files and Links with Data Loader

Salesforce, Add the Files Related List to Page Layouts

Salesforce, File Upload and Download Security

Videolink, Salesforce Integration

Table of Contents
Choosing the Right Loom Alternative
As teams work more asynchronously, many explore Loom alternatives built for real collaboration — not just recording.
Learn More
Stand Out in Hiring with Video
Whether you’re recruiting or interviewing, use short videos to connect, impress, and communicate with confidence.
Learn More
Record a GitHub Video Instantly
Show your updates, explain pull requests, or review code faster – record a quick video right from your workspace.
Get Integration
Record Your Screen to Share Ideas Fast
Capture demos, feedback, or updates in seconds – no meetings, no confusion.
Record a Video
Send a Video Email That Gets Noticed
Add a personal touch to every message with quick video emails that stand out in busy inboxes.
Learn More
Choosing the Right Loom Alternative
Description: As teams work more asynchronously, many explore Loom alternatives built for real collaboration — not just recording.
Learn More
Record a Support Video Instantly
Make support faster and clearer – record quick videos to explain fixes or request a video reply from the customer.
Learn More
This is some text inside of a div block.
This is some text inside of a div block.
Button Text

Upgrade Your Workflow

Als u voor Videolink kiest in plaats van Loom, gaat het er niet alleen om geld te besparen, maar ook om een tool te kiezen die is gebouwd voor eenvoud, flexibiliteit en echte waarde.