0

If I include a file link in a desktop Word document, I am able to follow it, for example

file:///C:/

or

file:///K://my_confidential_network_folder

In Sharepoint, the link is displayed as a link but I am not able to follow it (e.g. with Ctrl+Click). I expected that sharepoint would open the file uri in a new browser tab.

I also tried to use a single or double / in the uri:

  • Single / opens a new tab but does not show the folder
  • Double and tripple / do not react on click.

On the other hand, if I paste an uri in a browser address bar, it works when using double or tripple /. Single / does not work.

enter image description here

Instead of showing the file uri in a new browser tab, "nothing" happens from end user perspective. In the console there is an error

WordEditorDS.js:4697 Not allowed to load local resource: file:///C:/ 

=> How can I correctly include hyperlinks using the file uri scheme instead of http scheme in Sharepoint?

If that does not work, is there an alternative to link local network resources, so that Users with the corresponding access rights can easily follow them with a click?

Is there an option to specify that the uri should be openend in a new browser tab? Something like:

browser:ofv|u|file://C:/

(Unfortuntely, "browser" is not supported in the office uri scheme.)

Related:

0

1 Answer 1

0

a) This is a restriction by the browsers; they do not allow to open the file link for security reasons.

It is possible to install a google chrome extension and a companion executable (requires admin rights) to open local links. However, expecting all end users to do so is not realistic.

It would also possible to start a webserver that hosts the local files. Also see related SO question for more details:

https://stackoverflow.com/questions/2087894/can-google-chrome-open-local-links

https://chromewebstore.google.com/detail/local-explorer-open-file/eokekhgpaakbkfkmjjcbffibkencdfkl

b) As a workaround you can create a downloadable shortcut file for Windows:

file_link.url

[InternetShortcut]
URL=file:///C:

and upload it to Sharepoint as a Document.

Also see related question

https://stackoverflow.com/questions/77707743/how-to-avoid-that-firefox-appends-download-to-name-of-downloaded-file

c) Some web part, that would at least allow users to copy a file link to the clipboard with a single click... so that they are able to paste it in the Windows File Explorer... would be nice. Unfortunately, the SharePoint CodeSnippet WebPart does not have a copy button. Therefore, one would need to implement a custom copy-to-clipboard WebPart. Also see

https://powerusers.microsoft.com/t5/Building-Power-Apps/Copy-text-to-user-clipboard-on-click-of-a-button/td-p/910009

https://answers.microsoft.com/en-us/msoffice/forum/all/how-to-create-copy-to-clipboard-on-sharepoint/ff34fed1-c94d-425a-b63b-60579cb48b3e

Button on SPO Page that copies the URL of an item in a list view web part with a checkmark next to it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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