Guide

Personal data in Salesforce files: what a scan can read.

The riskiest personal data in a Salesforce org is often not in a field. It is in the scanned letter on a case, the spreadsheet someone exported and attached, the referral form on a contact. This guide sets out where files live in Salesforce, why field scanners do not see them, and what can honestly be read from each kind of file from inside the org. Statements about Salesforce are from its own documentation, read on 15 November 2026 and linked in the section that uses them.
The objects

Salesforce Files vs Attachments: where are files stored?

In four places, and the names matter because each is queried differently.

  • ContentDocument is the file itself, as uploaded to Salesforce Files or a content library.
  • ContentVersion is one version of that file, and holds its content. A file replaced twice is one ContentDocument and three ContentVersions.
  • ContentDocumentLink is where the file is shared. Salesforce describes it as the link between a file or note and the users, groups, records and libraries it is shared with.
  • Attachment is the older object: a file a user uploaded and attached to one parent record. Orgs that have been live for years usually hold both kinds.
fig. 01the two ways Salesforce holds a file · illustrative
Legacy
Attachment
Attachment
the file and its content
attached to
Case
its one parent record
One file, attached to one parent record.
Current
Salesforce Files
ContentDocument
the file
ContentVersion
version 1
ContentVersion
version 2 · the latest
shared by ↓
ContentDocumentLink
to a Case
ContentDocumentLink
to a Contact
ContentDocumentLink
to a user or group
ContentDocumentLink
to a library
One file, any number of versions, shared in any number of places.

The two differ in size as well. Salesforce's comparison gives a maximum of 2 GB for a Salesforce file and 25 MB for a file attachment. Both accept any file type.

Are Salesforce attachments being retired?

Many people ask. Salesforce's own comparison of the ways to hold a file still lists Attachments as one of them, for adding a file to a specific record from the Attachments related list. We found no retirement date on the pages we read. Whatever Salesforce decides, the attachments already in an org stay where they are until someone moves them, so a review of personal data has to cover both.

Notes written in the enhanced notes editor are files too. They are linked to records through ContentDocumentLink in the same way.

Salesforce's documentation for this section: ContentDocument, ContentVersion, ContentDocumentLink, Attachment, Differences Between Files, Documents and Attachments.

Counting them

Does a query on ContentDocument return every file?

Not necessarily, and this catches people out. Salesforce's reference says that, depending on how files are shared, a query on ContentDocument or ContentVersion without an ID does not return all the files a user has access to. Its example: a user who can see a file only because it is shared with a record they can see will not get that file back from a plain query.

So the first honest answer to “how many files do we hold?” is usually a lower bound. Any tool that gives you a file count should say which files it could see and which it could not. Salesforce allows up to 30 million documents in an org, so the gap can be large.

Salesforce's documentation for this section: ContentVersion, ContentDocument.

Field scanners

Does Salesforce Data Detect scan files and attachments?

No. Salesforce's documentation lists what Data Detect scans: text, long text, long text area, encrypted text and rich text fields. Files and attachments are not among them. That is not a flaw in Data Detect. It is a field scanner, and it does that job inside the platform. But it means a clean Data Detect result says nothing about your files.

For what Data Detect and Salesforce's other tools do cover, see our guide to Shield, Data Detect and Security Center.

Salesforce's documentation for this section: Create a Data Detect Policy and Run a Scan, Get Started with Data Detect.

File by file

What can be read from a file inside Salesforce, and what cannot?

It depends on the file. This is what Org Warden does with each kind, including the kinds it cannot read. We set it out in full because the limits are where a file scan either earns trust or loses it.

Word and Excel files (.docx, .xlsx), text, CSV, HTML, XML, JSON, notes

Opened and read
The text is taken out of the file inside your org and run through the same rules as a field, check digits included. A Word file is read with its headers, footers, footnotes and comments; a spreadsheet with every sheet.

PDFs that contain text, and older Word and Excel files (.doc, .xls)

Asked about, not opened
Org Warden asks Salesforce’s own search index whether words from its vocabularies appear in the file. That shows a term is present. It cannot validate a number, so card numbers, National Insurance numbers, NHS numbers, dates of birth and postcodes are never found this way.

Scanned documents, photographs, images

Not reachable
A picture of a letter has no text to read, and Org Warden has no optical character recognition. These files are counted and named as unreachable.

Saved emails (.msg, .eml), archives, audio, video

Not reachable
Counted and named, never opened.

Large files

Not opened
Salesforce allows a file of up to 2 GB. A file above the size the scan can hold in memory, about a megabyte and a half by default, is refused before it is fetched and named as too large. Where its type allows, the search index is asked instead.

Password-protected files

Not readable
Counted as a file that could not be parsed.

Three more limits worth knowing before you rely on any figure:

  • Only the latest version of a file is read. An earlier version that held something the current one does not is not scanned.
  • A file that arrived by email belongs to the email message, not to the case. The pack says so, because counting files per case would under-report.
  • What the search index says lags behind what was uploaded, so every count that comes from it is a lower bound.
PDFs

Can personal data inside a PDF be found?

Partly, and it is worth being exact. Org Warden does not open PDFs. For a PDF that contains text, it asks Salesforce's search index whether particular words are in it: a health condition, a blood type, a term from one of its vocabularies. A match tells you the word is in the file. It is evidence of a term, not a validated finding, and the pack labels it that way.

fig. 02the two routes a file can take in a scan
Route one
Opened and read
The file
Word and Excel files, text, CSV, HTML, notes
The text is taken out of the file, inside your org
Every rule runs on it, check digits included
What the pack states
A validated match, counted by rule and file type
Stops at the size limit: a larger file is not opened.
Route two
Asked about, not opened
The file
PDFs that contain text, older Word and Excel files
The file is never opened
Salesforce’s search index is asked whether a word appears in it
What the pack states
A term is present. Not a validated match
Cannot find a number: no card, National Insurance or NHS number.
Neither route
Scanned documents, images, saved emails, archives: counted and named as not reachable, never opened

What this cannot do is find a number. A rule that checks a card number's check digit, or the shape of a National Insurance number, needs the text in hand, and the index does not give it. Most of Org Warden's rules are of that kind, so for PDFs most rules are listed in the pack as not asked. A scanned PDF, which is a picture, cannot be reached at all.

If most of your sensitive documents are scanned PDFs, no tool that works inside Salesforce without sending the files elsewhere will read them. That is a real limit, and a reason to know how many such files you hold and where they are attached.

The result

What does a file scan report, and what leaves the org?

An Org Warden file scan sorts every file it can see into one of four groups: read, asked about through the search index, excluded with the reason, or not reached. The four add up to the files counted, so nothing is silently dropped.

Findings are counts: this rule matched in this many files of this type. No file name, title or path is in the Evidence Pack, and no file content or record ID. Where a count is under five, the exact number is withheld.

Whatever you use

Seven questions to ask about any file scan.

  • Which file types are opened and read, and which are only searched?
  • What happens to a PDF? To a scanned PDF?
  • Is there a size above which a file is not read, and are those files listed?
  • Is every version of a file read, or only the latest?
  • Whose access does the scan run with, and which files could it not see?
  • Do the files, or anything from inside them, leave the org?
  • Does the result say what was not read, or only what was found?

Our own answers to all seven are in the sections above. The last question matters most: a scan that reports only what it found leaves you unable to say what you have checked.

Short answers

Questions people ask about files in Salesforce.

Does Salesforce Data Detect scan files and attachments?

No. Salesforce’s documentation lists the field types Data Detect scans: text, long text, long text area, encrypted text and rich text. Files and attachments are not among them.

What is the difference between ContentDocument and ContentVersion?

ContentDocument represents the file. ContentVersion represents one version of it, and holds the content. Upload a new version of a file and you have one ContentDocument with two ContentVersions.

What is ContentDocumentLink?

It is the record of where a file is shared. Salesforce describes it as the link between a file and the users, groups, records and libraries it is shared with. One file attached to three cases has three links.

Does a query on ContentDocument return every file?

Not necessarily. Salesforce’s reference says a query without an ID does not return all the files a user has access to: a file the user can see only because it is shared with a record they can see is not returned.

Can personal data inside a PDF in Salesforce be found?

Partly. Org Warden does not open PDFs. It asks Salesforce’s own search index whether words from its health and other vocabularies appear in them. That shows a term is present. It cannot validate a card number or a National Insurance number, and a scanned PDF with no text in it cannot be reached at all.

Are Salesforce attachments deprecated?

Salesforce’s comparison of Files, Documents and Attachments still lists Attachments as a way to add a file to a record, with a 25 MB limit against 2 GB for Salesforce Files. We found no retirement date on the pages we read. Attachments already in an org stay there until someone moves them.

Salesforce Files vs Attachments: what is the difference?

Attachment is the older object: a file uploaded and attached to one parent record. Salesforce Files use ContentDocument and can be shared in many places. An org that has been live for years usually has both.

Each section links the Salesforce page it draws on, read on 15 November 2026. Every product name is a mark of its owner. What we say about Salesforce is our reading of its public documentation, and products change; if something here is wrong or out of date, tell us at hello@orgwarden.co.uk and we will correct it.
See it working

Book a demo.

In a demo we take you through the Console on a demonstration estate whose data is all made up: a rule opened onto every org where it matched, and an Evidence Pack checked by its hash.

Work email · or write to hello@orgwarden.co.uk · we reply within 1 business day