SharePoint Online: How to add a PDF in file and media web part in a template so it automatically appears in the Attachments web part as a link to that PDF file?

Biswal, Punam 0 Reputation points
2026-05-08T02:51:12.4866667+00:00

Hi,

I am working with a modern SharePoint Online page template.

I added both File and media and Attachments web parts to the page.

When I upload a PDF using the File and media web part, I expect the file to automatically appear under the Attachments web part, but it does not.

Additionally, when I select the Attachments web part, I do not see any option to “Add attachment.”

How are attachments supposed to be added to modern SharePoint pages, and is there a supported way to automatically link a file uploaded via File and media so it appears in the Attachments web part?

Microsoft 365 and Office | SharePoint | Development
0 comments No comments

3 answers

Sort by: Newest
  1. Paraoan, Greyzelle Anne Louise (Student) 0 Reputation points
    2026-09-24T06:25:43.8333333+00:00

    Was this answer helpful?

    0 comments No comments

  2. Anonymous
    2026-05-08T04:56:29.53+00:00

    Hi Biswal, Punam

    Based on the current Microsoft documentation, there isn’t an “Attachments” web part available in modern SharePoint pages.

    Could I clarify what you mean by the Attachments web part in your scenario?

    From your earlier description, are you expecting that when you upload a file (for example, a PDF) using the File and Media web part, it would also appear in a Document Library web part, like in the example shown below?

    User's image

    If that’s what you’re looking for, just to clarify, files added through the File and Media web part are only displayed on the page itself. While the file is stored in the site (typically in Site Assets), it does not automatically appear in a Document Library web part.

    If this isn’t what you’re referring to, please feel free to share a bit more detail so I can better understand your scenario.

    Please understand that our initial reply may not always immediately resolve the issue. However, with your help and more detailed information, we can work together to find a solution.     


    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


  3. AI answer

    2026-05-08T02:51:26.1833333+00:00

    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:

    1. Use File and Media to display a specific file on the page, or
    2. 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:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.