Loading

Include attachments in web-to-case or web-to-lead

Veröffentlichungsdatum: Jun 14, 2026
Beschreibung

Standard Salesforce Web-to-Case and Web-to-Lead functionality does not support file attachments. When a customer submits a case or lead via an external web form, any files they want to include cannot be uploaded through the native Web-to-Case or Web-to-Lead mechanism. This article explains two supported workarounds to enable file attachment capability alongside case and lead submissions from external web forms.

Lösung

Standard Limitation

By design, standard Web-to-Case and Web-to-Lead do not support file attachments. This is a known product limitation with no out-of-the-box configuration option to enable it.

Workaround 1: Visualforce Page on Salesforce Experience Cloud Site

Create a Visualforce page hosted on a Salesforce Experience Cloud site (or Force.com Site). The page includes standard Case or Lead fields alongside a file upload component — for example, using apex:inputFile or a custom LWC uploader component. When the form is submitted, a new Case or Lead record is created in Salesforce with the file attached. This approach allows full control over the form design, field inclusion, and file handling logic.

Workaround 2: Platform API Implementation

Use a custom external application or integration layer that calls the Salesforce REST API or SOAP API. The external web form collects Case or Lead fields and file data. The external application then makes API calls to: (1) Create the Case or Lead record in Salesforce, and (2) Attach the file using the ContentVersion and ContentDocumentLink objects.

Implementing for Web-to-Lead

Both workarounds described above can similarly be implemented for Web-to-Lead scenarios. Replace Case object references with Lead object references in the Visualforce page implementation or in the API calls.

IdeaExchange

There is an active idea on the Salesforce IdeaExchange for native Web-to-Case attachment support. Customers can upvote this feature request to prioritize its development.


 

Nummer des Knowledge-Artikels

000386429

 
Laden
Salesforce Help | Article