File and Media Web Part in SharePoint Online

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

  1. 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
  2. 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.
File and media web part in SharePoint online
  • Now search for a File and Media web part and select it as shown below:
File and media web part in SharePoint
  • 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.
How to use File and media web part in modern SharePoint
  • In the next window, click on Add file as shown below.
How to use File and media web part in SharePoint
  • Now, we can see a file has appeared on a SharePoint page.
How to use File and media web part in SharePoint online

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:
Add File and media web part in SharePoint
  • 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.
Add File and media web part in modern SharePoint
  • 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.
Add File and media web part in modern SharePoint online
  • Now expand Connect to source -> Choose the document to connect. I have selected HR-Related Documents -> Click on Republish button.
SharePoint File and media web part
  • Now, select the document from the Document Library web part, and it will be displayed in the File and Media web part.
SharePoint online 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: