# Connect Paige to M-Files

M-Files reads a same-named XML file next to every imported document — and that is exactly what Paige writes. Point Paige at a folder the M-Files server can see, create an external file source that reads Paige's XML with XPath, and finished documents arrive in the vault with their class and properties already set.

Product: paige · Audience: system-administrator · Time: 1 hour · Last verified: 2026-09-05

Canonical: https://help.ademero.com/paige/integrations/connect-paige-to-m-files

**At the end of this guide, every document Paige finishes appears in your M-Files vault as a searchable PDF with its class and properties already filled — vendor, invoice number, date, amount, whatever your scan job extracts — without anyone opening the metadata card.**

M-Files (also written *M‑Files* or *MFiles*) is one of the cleanest fits for Paige. Its **external file source** feature watches a folder, imports every file it finds, and can read property values from an XML file that has the same name as the document. Paige's SFTP export writes precisely that pair: `document.pdf` beside `document.xml`. No middleware, no automation platform, no code.

## How the handoff works

1. Paige finishes a document and uploads it to your SFTP folder as a PDF, then writes `.json`, `.xml`, and `.csv` files with the same base name.
2. The M-Files server checks the folder on the interval you set, finds the PDF, looks for the same-named `.xml`, and reads the values you mapped with XPath expressions.
3. The document is created in the vault with the class and properties you defined. The source PDF and XML are deleted (your choice), so the folder stays empty.

Paige's XML for a document looks like this:

```xml
<export>
  <metadata>
    <pdf_file>scan_job_abc123_page_def456_20260905_141502.pdf</pdf_file>
    <scan_job_id>abc123</scan_job_id>
    <page_id>def456</page_id>
    <export_timestamp>2026-09-05T14:15:02.101234</export_timestamp>
    <document_type>Vendor Invoice</document_type>
  </metadata>
  <fields>
    <field name="Vendor Name">Acme Office Supply</field>
    <field name="Invoice Number">INV-20441</field>
    <field name="Invoice Date">08/28/2026</field>
    <field name="Total">1,284.50</field>
  </fields>
  <line_items>
    <table name="Line Items">
      <headers><column>Description</column><column>Qty</column><column>Amount</column></headers>
      <rows>
        <row index="0"><cell column="Description">Copy paper, case</cell><cell column="Qty">10</cell><cell column="Amount">449.00</cell></row>
      </rows>
    </table>
  </line_items>
</export>
```

Every Paige field is a `<field>` element whose `name` attribute is the field's name in the scan job. That's what the XPath expressions below select.

## Step 1 — Prepare the folder

The M-Files **server** (not your workstation) must be able to read and delete files in the folder Paige writes to, using a path that makes sense from the server.

- **Easiest:** run an SFTP server on the M-Files server itself, or on a Windows file server the M-Files server already reaches, and give Paige a folder such as `D:\PaigeImport\Invoices`. Any Windows SFTP server works; Windows Server's built-in OpenSSH Server is enough.
- Make sure the account M-Files uses for the file source (by default the server's Local System account, or one you set) has read, write, and delete rights on that folder.
- Open port 22 inbound from Paige's address ranges on your firewall — [Outbound IP ranges for firewall allow-lists](/paige/document-processing/outbound-ip-ranges-for-firewall-allow-lists) lists them and explains how to test from outside your network.

Use one folder per scan job. Each folder becomes one M-Files file source with one class and one property mapping.

## Step 2 — Point Paige at the folder

1. In Paige, open **Settings** (the gear at the bottom of the left menu — administrators only), pick the scan job, and choose **Export**.
2. Click the **FTP** card. Enter the server's **FTP Address**, **Port** `22`, the **Username** and **Password** of the SFTP account, and in **FTP Folder Path** the folder from Step 1 as the SFTP account sees it (for example `/Invoices`).
3. Click **Test Connection**. **What you should see:** `FTP connection successful!` Then connect — `Connected to FTP Server!` and a green **Connected** label on the card.
4. Leave **Generate combined metadata file** off. M-Files reads the per-document XML; a combined file would just be imported as a stray document.
5. Turn on **Enable Auto Export** and, under **Auto Export Settings**, switch on **Only documents having a document type**, set **Human Reviewed** to **Reviewed** if a person checks documents in Paige first, and **Auto Field Entry Complete** to **Yes**. Click **Save**.

*[Screenshot: Paige's FTP export dialog filled in for an M-Files import folder, with the connection test successful]*

## Step 3 — Create the external file source in M-Files Admin

1. Open **M-Files Admin**, expand the server connection, then **Document Vaults** > your vault > **Connections to External Sources** > **File Sources**.

2. Right-click **File Sources** and choose **New File Source…**.

3. On the **General** tab:
   
   | Setting | Value |
   |---|---|
   | **Description** | Something like `Paige – Vendor Invoices` |
   | **Path from the server** | The folder from Step 1, as the M-Files server sees it (for example `D:\PaigeImport\Invoices`) |
   | **Include subfolders** | Off |
   | **Filters** | Include files matching `*.pdf` — this keeps the `.json` and `.csv` siblings from being imported as documents |
   | **Import files** | Selected (not **Link files**) |
   | **Delete source file after importing** | On |
   | **Check for new and deleted files periodically** | On, with a **Delay between checks** of `60` seconds or so |
   
   > important: The path is evaluated on the M-Files server, and the account under **Set Account** must have rights to it. If you enter a path that only exists on your own PC, nothing will ever import and M-Files won't tell you why.

4. On the **Metadata** tab:
   - Set the **Class** the imported documents should get (for example *Purchase Invoice*).
   - Check **Read values from an XML file**, and check **Delete the XML file after use** so the folder is cleaned up.
   - Click **Add…** for each property you want filled. In the **Define Property** dialog pick the property, choose **Read from an XML file**, and enter the XPath expression:
   
   | M-Files property | XPath expression |
   |---|---|
   | Vendor (or any text property) | `export/fields/field[@name='Vendor Name']` |
   | Invoice number | `export/fields/field[@name='Invoice Number']` |
   | Invoice date | `export/fields/field[@name='Invoice Date']` |
   | Total | `export/fields/field[@name='Total']` |
   | Document kind, if you keep one | `export/metadata/document_type` |
   
   The text inside the brackets must match the field's name in Paige exactly, including capitalization and spaces. If a property is a **Choose from list** type (a vendor object, say), tell the dialog whether the captured value is the item's **name** or its **ID** — for Paige data it's the name.

5. Click **OK** to save the file source.

## Step 4 — Test it

1. Process one document through the scan job in Paige (review it if you required review) and wait for the export.
2. Watch the import folder on the M-Files server: the PDF and its three data files appear, then within your check interval the PDF and XML disappear.
3. In M-Files, search for the document. **What you should see:** the PDF, in the class you set, with the mapped properties filled from Paige's values. Open it — the text is selectable, which is Paige's searchable layer.

The `.json` and `.csv` files stay behind in the folder because the filter excluded them; delete them on a schedule or widen the filter to import them too. If you prefer a clean folder, ask Paige support about limiting which descriptor files a scan job writes.

## When it doesn't work

| Symptom | Where to look |
| --- | --- |
| Files arrive but M-Files never imports them | The path or account on the **General** tab is wrong from the server's point of view, or the periodic check is off. |
| Documents import with empty properties | The XML wasn't found (name mismatch means the PDF's base name differs — Paige always matches them, so check the filter didn't import a different file) or an XPath has a typo. XPath errors are logged in the **Windows Event Viewer** application log on the M-Files server. |
| A date or number property is empty while text ones are filled | The value's format doesn't match the property type. Paige exports values as text exactly as they appear on the page — set the property to text, or fix the format with a workflow in M-Files. |
| A "Choose from list" property is empty | The value isn't an existing list item and the dialog is set to match by ID. Switch to matching by name. |
| Nothing arrives from Paige | The auto-export criteria aren't met, or the document was processed before you turned auto export on. Export it once from the **Documents** page with the **Export** button and tick **FTP**. |

If the Paige side is the problem, contact Ademero support with the scan job name and the message from **Test Connection**.

## What's next

- [Set up scan jobs](https://help.ademero.com/paige/document-processing/set-up-scan-jobs)
- [Write extraction guidance the AI can follow](https://help.ademero.com/paige/document-processing/write-extraction-guidance-the-ai-can-follow)
