0

I have an HTML file sitting on a shared network server:

SERVERNAME\users\public\Documents\Directory.html

When I put the above path (starting with ‘\’) into a web browser, the browser renders the HTML and the page is displayed as expected. Within SharePoint, I’m attempting to use the script editor to embed an IFrame and display the Directory.html page. (I’m opting not to use the Page Viewer as I’m told if you’re linking to a file, you must be using IE). My Iframe looks like below:

<iframe src="\\SERVERNAME\users\Public\Documents\Directory.htm"></iframe>

I’ve also tried:

<iframe src="file://\\SERVERNAME\users\Public\Documents\Directory.htm"></iframe>
<iframe src="file://\\SERVERNAME\users\Public\Documents\Directory.htm"></iframe>

No matter what source I use, the result is always an empty html frame. How can I get this page to load in SharePoint? Is there a setting I’m missing here? Note: SharePoint is configured to use http and I’m using IE for dev/testing.

Also, The following IFrame correctly displays the bing home page:

<iframe src="http://www.bing.com"></iframe>

However I'm still unable to IFrame to the directory file

Edit - Adding screen shot below: enter image description here

  • 1
    Try creating an html file in your desktop and place IFrame to load the file from shared path. Just to make sure it works outside SharePoint or not. – Amal Hashim Mar 22 '16 at 18:00
  • An HTML file on my Desktop will not load, I can browse to it via Windows Explorer and a web browser from other machines; but I can't embed it into a SharePoint iFrame or Web Part. How do I fix this? – slashNburn Mar 22 '16 at 21:16
  • Most likely a Publishing site where SharePoint will take all URLs under source-control (so when you rename a SharePoint page/Change the URL all URLs are rewritten); alas this also applies to you file: urls... Check the page source code, if they are no longer written as file: .... you have a problem I can't fix either – Danny '365CSI' Engelman Mar 23 '16 at 7:56
1

It's easiest to use the Page Viewer web part instead of script edit. You can select "File" and enter your path: file://SERVERNAME\users\Public\Documents\Directory.htm

  • I've tried using this directory format in a Page Viewer Web part with the server name, ip address, and FQDN. No Network files will render in the Web Part (or embedded iFrames). – slashNburn Mar 22 '16 at 21:12
  • I did this on my site with the syntax displayed above and it worked. Did you indicate that it was a file rather than a page? – Erin L Mar 23 '16 at 15:37
  • Yes - I edited my main post and added a screen shot; does anything look out of order here? – slashNburn Mar 23 '16 at 15:51
  • It does look right. Does the "Test Link" work? – Erin L Mar 23 '16 at 15:58
  • No - I click it and nothing happens. – slashNburn Mar 23 '16 at 16:24
-1

Save the HTML file in site assets and use that URL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.