In this Salesforce tutorial, we will learn to attach files in Salesforce Record Pages and Email templates and discuss this method of attaching files in Salesforce Lightning and Salesforce Classic.
Attach Files to the Records in Salesforce
In Salesforce, attaching files to records is a better way to organize the information. With the help of these attachments, we can share information with anyone having access to these records. We can attach files such as MS Office documents, PDFs, images, and videos to most Salesforce records through the Files.
While working as a system administrator for an organization that uses Salesforce as a CRM tool, I was asked to attach files to the opportunity record pages. The reason behind that was the sales team, which frequently interacts with clients by sharing various documents, such as reports, contracts, and presentations. They decided to attach files to Opportunity Records to organize their sales processes and keep all required information in one place.
I will explain how to attach files to records using examples, and you can follow the same procedure to attach various files and documents to records of Cases, tasks, and campaigns.
We will discuss the file attachment in Salesforce through the following points.
- Attach Files to the Records in Salesforce Lightning
- Attach Files to the Records in Salesforce Classic
- How to attach a file to an email template in Salesforce
- Attach Files to Multiple Records in Salesforce
Limitations for attaching files in Salesforce
There are some limitations to uploading these attachments to Salesforce records.
- In Salesforce Classic, the size limit for the attached file is 25 MB, while in Salesforce Lightning, it is 2GB.
- The file size limit for Chatter feed attachments is 2 GB.
- The size limit for an email message, including attachments, is 25 MB.
- If the Don’t allow HTML uploads as attachments or document records security setting is enabled for your organization, you can’t upload files with the following extensions: .htm, .html, .htt, .htx.
- Uploads from the Files-related list aren’t supported in the Salesforce mobile app.
- Salesforce doesn’t remove geolocation information from uploaded images.
Attach Files to the Records in Salesforce Lightning
To attach Files to the records in Salesforce Lightning, navigate to the Setup page and follow the below steps.
1. On the Setup page, click on the App Launcher and navigate to the object tab, where you attach files to records.

2. Select the record to which you want to attach files. In this case, I have selected the opportunity Edge Emergency Generator.

3. In the selected record, there are three tabs: Details, Activity, and Chatter. Click on the Details tab.

4. In the Details tab, scroll down to Notes & Attachments and click on the Upload Files button.

5. In this step, open the file location and open the file you have to attach to the record. In this example, I have selected a .xlsx file Opportunity specifications to attach to the opportunity record.

6. It will take a while to upload, and once the upload is complete, click on the Done button.

As we click on the Done button, we can see the attached file in the section Notes & Attachments as shown in the picture below.

In this way, we have successfully attached or uploaded files to the records in Salesforce Lightning.
Attach Files to the Records in Salesforce Classic
To Attach Files to the Records in Salesforce Classic, login to your Salesforce account and follow the steps below.
1. On the Home page of Salesforce Classic, click on the Opportunities tab.

2. In this step, select the opportunity record to which you have to attach files. In this case, I have selected the opportunity record name Elektron Technologies to attach files to it.

3. In the selected record, scroll down and go to the section Notes & Attachments and click on the button Attach File.

4. In this step, click on the Choose File button under the heading Select the File.

5. As we click on the button Choose File, it will open the browser, and from here open the file location. In this case, I have selected the file name Elektron Technologies Timeline. After selecting the file, click on the Open button.

6. In this step, click on the button Attach file, and when the upload is complete, the file information will appear below. Once the file has been uploaded, click on the Done button, as shown in the picture below.

As we click on the Done button, the file will be attached to the opportunity Records and we can see the attached file in the Notes & Attachments section.

With this step, we have successfully attached a file to record in Salesforce Classic.
How to attach a file to an email template in Salesforce
The feature of attaching files is available in Salesforce Lightning and Salesforce Classic. We will discuss attaching files to an email template in Salesforce Lighting and Salesforce Classic.
Attach a file to an email template in Salesforce Lightning
To attach a file to an Email template in Salesforce Lightning, follow the below steps.
1. Click on the App Launcher and search, then select Email Templates.

2. Click on the template name to which you have to add an attachment.
3. Scroll to the Files section and click on Upload Files.

4. Browse the file from your system and click on Open.
5. After uploading the file, click on the Done button.

The uploaded file will be visible in the Files of the Email template.
This way, we can attach a file to the Email template in Salesforce Lightning.
Attach a file to an email template in Salesforce Classic
To attach a file to a Classic email template in Salesforce, follow the below steps.
1. On the setup page of Salesforce Classic, go to the Administer section on the left sidebar and select Communication templates -> Classic Email templates.

2. Click on the Email Template Name to which you need to attach files.
3. In the Email template, go to the section Attachments and click on the Attach File button.

4. Now, you will see the instructions below for attaching the file.
- Select the file from the browser; the file size should not exceed 25 MB.
- Click the Attach file button. (repeat these two steps to attach multiple files).
- Click Done.

In the Attachment section, we can see the attached file.
This way, we can attach files in Salesforce Classic templates.
Attach Files to Multiple Records in Salesforce
To attach files in multiple records, we can use the Salesforce data loader that is capable of managing big data. For this, you must have installed the Salesforce Data Loader tool in your system.
To attach the files using the Salesforce data loader tool, follow the below steps.
1. First, we need to create a CSV file to insert data with the data loader.
In the CSV file, add the columns Title, Description, VersionData, PathOnClient, and FirstPublishLocationId. In the columns, VersionData and PathOnClient, enter the file’s system path.
In the column FirstPublishLocationId, enter the ID of the object record to which you have to attach files, for example, Account, contacts, leads, and Opportunity.

2. Open the Salesforce Data loader and click on the Insert button.

3. Login with your credentials in the data loader.
4. Click the checkbox Show all Salesforce Objects, select the object Content Version, browse the CSV file we created, and click on the Next button.

5. In the Mapping window, click Create or edit a map. Then, in the next window, click Auto-match fields to columns. Now, the fields will auto-match to the header columns, and if they don’t, you have to drag the objects to the column mapping.
After this, click OK, then click Next.

6. Click on the Finish button.

7. As we click on the finish button, a warning message will appear, and here, click on the Yes button to proceed.

8. As the data import is completed, we can see the number of successes and errors during the operation.
Click OK button to end the data operation.

9. Navigate to the object record and go to the Notes and Attachments section. The attached files will be there.

This way, we can attach multiple files to records using the Salesforce data loader.
Conclusion
In this Salesforce tutorial, we have learned about attaching files to records in Salesforce Lightning and Salesforce Classic.
Along with this, we also learned to attach files in Salesforce Lightning and Classic email templates. We have used the Salesforce data loader tool to attach multiple files to a record.
By following all the above methods, you can attach files to the records in your Salesforce instance and organize your data.
You may like to read:
- Delete and Deactivate Opportunity Stage Picklist Value in Salesforce
- How to add Image to an App page in Salesforce
- How to Delete the Records Using Data Loader in Salesforce
- How to Import Attachments with Data Loader in Salesforce
- How to Import Leads as Campaign Members with Data Loader in Salesforce
- How to Upload Files Using Screen Flow in Salesforce
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.