The SharePoint File and Media web part effectively displays and interacts with files directly within a SharePoint page. This SharePoint Online tutorial will teach us about the SharePoint Online File and Media Web Part. Also, we will see how to add files to a page using the SharePoint File and Media web part.
Moreover, I will show you how to dynamically display a document on a SharePoint page using the File Viewer web part.
SharePoint Online File and Media Web Part
- In SharePoint, a file and media web part allows users to view the contents of a file without downloading it or opening it in a separate application. The main purpose of this web part is to allow users to insert files into SharePoint modern pages
- It also lets users directly preview the contents of many different types of files, including Microsoft Office documents, PDFs, images, and videos, in the browser. The below screenshot represents how SharePoint File Viewer Web Part looks.
This is what a SharePoint online File and Media web part looks like.
Add a File and Media Web Part in SharePoint Online
Here, we will see how to add a file viewer web part in SharePoint online.
- Open a SharePoint online site page where you want to add a file viewer web part.
- Click on the + icon where you want to add the new web part.

- Now search for a File and Media web part and select it as shown below:

- Now it opens a dialogue box, where we can select a file from:
- Recent = These are the files used recently in your SharePoint Site.
- One Drive = Here, we can see the saved documents from the SharePoint Site to one drive.
- Site = These are the files already uploaded on the SharePoint site.
- Upload = Here, we can select a file from the local device.
- From link = We can insert links to the files we want to add.
- Select Upload -> choose a file from your local device -> click on the Open button.

- In the next window, click on Add file as shown below.

- Now, we can see a file has appeared on a SharePoint page.

This is how we can add File and Media web part in SharePoint Online.
Dynamically Display a Document on a SharePoint Page Using the File Viewer Web Part
This section will show how we can dynamically display a document in SharePoint using the File Viewer Web Part.
To do that, follow the steps listed below.
- Open a SharePoint Online Site page.
- Take a Two columns Section. In 1st section, add a document library web part -> In another section add the File and media web part as shown below:

- Select a document from the Document Library. I have selected the HR-Related Documents. Now, we can view all the document library files that will be displayed as shown below.

- Now in the 2nd section, File and Media web part, Click on the Edit web part icon-> a dialogue box appears as File and Media, click on (…) ellipses -> Then select Connect to source.

- Now expand Connect to source -> Choose the document to connect. I have selected HR-Related Documents -> Click on Republish button.

- Now, select the document from the Document Library web part, and it will be displayed in the File and Media web part.

This is how we dynamically display a document on a SharePoint page using the file viewer web part.
Conclusion
We have seen the SharePoint File and Media web part from this SharePoint Online tutorial. Also, we have learned how we can add files to a page with the SharePoint File and Media web part. We have also understood how to dynamically display a document on a SharePoint page using the file viewer web part.
You may also like:
- Call To Action Web Part in SharePoint Online
- Bing Maps Web Part in SharePoint Online
- SharePoint Online Page Properties Web Part
- Planner Web Part in SharePoint Online

Preeti Sahu is an expert in Power Apps and has more than 6 years of experience working with SharePoint and the Power Platform. As a Power Platform expert for Power BI, Power Apps, Power Automate, Power Virtual Agents, and Power Pages, she is currently employed with TSinfo Technologies. She is the author of the book Microsoft Power Platform A Deep Dive. She also made a big technical contribution to SharePointDotNet.com in the form of articles on the Power Platform. She enjoys traveling and spending time with her family in her spare time.