The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
The File and Media web part and the Attachments web part do not integrate in the way described, and there is no supported mechanism in modern SharePoint pages for a file uploaded via File and Media to automatically appear as an “attachment” in another web part.
From the available documentation:
- The File and Media (File viewer) web part is designed to insert and display a file directly on the page (Word, Excel, PowerPoint, Visio, PDFs, 3D models, videos, etc.). Files uploaded from the computer are stored in the SiteAssets library in a folder named after the page under the SitePages folder, and the web part simply renders that file on the page.
- The File and Media web part can also be connected to a Document Library web part so that the file shown changes dynamically based on what a user selects in the Document Library. This is the supported “linking” behavior for that web part, not an attachment model.
The provided documentation does not describe an Attachments web part for modern pages, nor any API or configuration that:
- Treats files uploaded via File and Media as page “attachments”, or
- Automatically surfaces those files in another web part as attachment links.
Based on this, supported options for modern pages are:
- Use File and Media to display a specific file on the page, or
- Use a Document Library web part plus File and Media web part connection so that selecting a document in the library shows it in File and Media, as described in the “Connect web parts in SharePoint” guidance.
There is no supported, built-in way in modern SharePoint pages (per the provided context) to:
- Add attachments to the page itself in the classic “attachments” sense, or
- Automatically sync or mirror File and Media uploads into an Attachments web part.
A supported pattern is therefore to store PDFs in a document library and either:
- Link to them directly (e.g., via text or Quick Links web parts), or
- Use a Document Library web part + File and Media web part connection so the selected file is displayed.
References: