File Upload
Let users upload one or more files from a Dynamic Component, saved as Salesforce Files and linked to a record, with format limits and file naming options.
Overview
The Avonni File Upload component lets users upload one or more files directly from within your Dynamic Component. Uploaded files are saved as Salesforce Files and can be automatically linked to a specified record.
You can restrict acceptable formats, control whether multiple files are allowed, and customize file naming with prefixes or suffixes.
Common use cases
Attaching proposals or contracts to Opportunity records.
Uploading supporting documentation for Case records.
Adding images or specification sheets to Product records.
Submitting assignments or completed forms with attachments in a custom workflow.
Allowing users to upload profile pictures or identification documents.

Projects
See how File Upload fits into a complete Salesforce workflow. Each project includes steps to build it with AI or manually.

Ask what the question is about, then answer it, so the case is never opened.
Configuration
To configure the File Upload, select it on the canvas. The Edit File Upload panel opens on the right. The sections below mirror the Properties tab.

Properties
Label
The text label displayed for the file uploader.

Field level help
Help text detailing the purpose and function of the file uploader. It appears next to the label, typically as a tooltip icon, and can provide additional instructions such as accepted formats or size limits.
Variant
Changes the appearance and positioning of the Label relative to the uploader control.
Standard (default)
Label appears above the uploader.
Label Hidden
Label is hidden.
Label Inline
Label appears to the left.
Label Stacked
Label appears above with stacked styling.

Accepted Formats
A list of file extensions that users are allowed to upload (e.g., .pdf, .jpg, .png). Include the leading dot for each entry. Leave empty to allow all file types.
Allow Multiple Files
Specifies whether a user can upload more than one file simultaneously. When disabled, only a single file can be uploaded per interaction.
Show File Uploaded
If enabled, the uploader displays a list of files that have been successfully uploaded.
Uploaded Files Display Variant
Changes the appearance of the uploaded files display. Defaults to List. Requires: Show File Uploaded = enabled.
List — the uploaded files are listed one per row.
Pill Container — the uploaded files are shown as pills in a single wrapping container.
Stretch
If enabled, the file uploader takes the entire available width of its container.
Required
If enabled, the user must upload at least one file before the form can be submitted.
Disabled
If enabled, the uploader is disabled and users cannot interact with it.
Related Record Id
The record ID of the record that the uploaded file will be associated with. Bind this to a dynamic value — for example, $Component.recordId to link uploaded files to the current record page, or a Variable that holds the target record ID.
For guest users on an Experience Site, use Guest File Field Name and Guest File Field Value instead. See Let Guest Users Upload Files.
File Name Prefix
Text added to the beginning of the original filename when the file is saved in Salesforce. For example, a prefix of Contract_ applied to Details.pdf produces Contract_Details.pdf.
File Name Suffix
Text added to the end of the original filename (before the extension) when the file is saved. For example, a suffix of _Final applied to Report.docx produces Report_Final.docx.
File Name Prefix and File Name Suffix aren't applied to files uploaded by guest users.
Guest File Field Name
The API name of a custom text field on the Content Version object that receives the Guest File Field Value when a guest user uploads a file. The field name must end with fileupload__c (for example, Guest_Record_fileupload__c). In an org with a namespace, include the prefix.
Guest File Field Value
The value saved in the Guest File Field Name field of each file a guest user uploads. Your flow reads it to find the record to link the file to. Bind it to a resource or variable, such as a constant holding the target record ID or a value from your form.
Set Component Visibility
All components support conditional visibility — see Component Visibility.
Use Cases
Let Guest Users Upload Files
On a public Experience Site, unauthenticated visitors can upload files that are linked to a record of your choice. Salesforce reassigns each file uploaded by a guest user to the site's default owner, so the File Upload can't link the file itself. Instead, it saves the Guest File Field Value on the uploaded file, and a record-triggered flow creates the link.
Before you start, make sure the site and its guest user can run Dynamic Components. See Experience Sites Integration.
Create the Content Version field
In Setup, open Object Manager → Content Version → Fields & Relationships, and create a Text field. Its API name must end with fileupload__c (for example, Guest_Record_fileupload__c).
Allow guest uploads
In Setup → Salesforce Files → General Settings, select Allow site guest users to upload files.
In your site's Workspaces → Administration → Preferences, select Allow guest users to access public APIs.
Create the flow that links the file
Create a Record-Triggered Flow on Content Version that runs when a record is created, with an entry condition of your field Is Null = False. Optimize it for Actions and Related Records, then add:
Get Records on the object you link files to (for example, Case), where Id equals your Content Version field. Store only the first record.
Decision: continue only if the Get Records step found a record.
Create Records on Content Document Link:
ContentDocumentId:
{!$Record.ContentDocumentId}LinkedEntityId: the Id of the record found in step 1
ShareType:
VVisibility:
AllUsers
Save and activate the flow.
Configure the File Upload
Set Guest File Field Name to your field's API name and bind Guest File Field Value to the target record ID.
Guest users can't rename or delete the files they upload, so the Delete and Rename actions are hidden for them, and File Name Prefix and File Name Suffix aren't applied.
Interactions
Interactions define what happens when users interact with the File Upload. Configure them from the Interactions tab of the Edit File Upload panel.
Change
Fires when a user uploads a file. The contentDocumentIds output variable is populated with the IDs of all successfully uploaded files, which you can use to drive downstream logic such as linking files to a record, refreshing a related list, or navigating to another page.
Output Variables
The File Upload exposes this output variable you can reference elsewhere on the page after the user uploads a file.
File Upload
When a user successfully uploads one or more files, this variable is populated with the resulting Salesforce record IDs.
Content Document Ids
Text Collection
The IDs of the ContentDocument records created for each uploaded file.
Example: After a user attaches a signed contract, use Content Document Ids to pass the file ID to a custom action that links it to the related Opportunity record.
Styling
Configure the File Upload's appearance from the Style tab of the Edit File Upload panel.
Controls the outer spacing around the component.
Top / Right / Bottom / Left: Adjust the space on each side.
Controls the inner spacing between the component's content and its border.
Top / Right / Bottom / Left: Adjust the inner spacing on each side.
Controls the component's dimensions.
Width / Height: Set fixed dimensions.
Min Width / Max Width / Min Height / Max Height: Constrain the size within bounds.
Overflow: Control how content that exceeds the bounds is handled.
Customizes the border surrounding the component.
Color / Size / Style / Radius: Set the border color, thickness, style, and corner rounding.
Styles the component's main label.
Color / Font Size / Font Style / Font Weight: Set the label color and typography.
Styles the uploaded-file name text and the list divider.
File Name: Color / Font Size / Font Style / Font Weight.
File List Border Bottom: Color / Size / Style.
Last updated
Was this helpful?
