Forum Discussion

Warwick Ward's avatar
Warwick Ward
Bronze Contributor
Sep 12, 2017

Modern SharePoint File Viewer URL

 

Is there a way to open a file in the modern library File Viewers from a html link on a page?

 

Or will these file viewers only ever work from a link in a modern document library? they seems to just overlay the view in the current page. There must be a handler on the page to call the file viewer, as the url doesn't seem special.

 

  • Looks like I answered my own question, you can just build the link using

    https://tenant/sites/sitename/assets/Forms/AllItems.aspx?id=/sites/sitename/assets/filename.wmv&parent=/sites/sitename/SiteAssets/pagename.aspx

    The X button on screen will redirect to the parent in a new window, not the nice UX but at least it doesn't redirect the user back to the raw list view from a custom page.
  • Warwick Ward's avatar
    Warwick Ward
    Bronze Contributor
    Looks like I answered my own question, you can just build the link using

    https://tenant/sites/sitename/assets/Forms/AllItems.aspx?id=/sites/sitename/assets/filename.wmv&parent=/sites/sitename/SiteAssets/pagename.aspx

    The X button on screen will redirect to the parent in a new window, not the nice UX but at least it doesn't redirect the user back to the raw list view from a custom page.

Resources