How to hyperlink a file path (e.g: \\servername\folderX\file.vbs) into a notification email script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2019 05:20 AM
Hi all,
I have a requirement to add a clickable link into a notification, which will be sent to user on request completion.
The link should redirect user to a file present on a server. I tried using the following syntax into my email script , but it is not working.
<a href="file:///\\servername\folderX\file.vbs"target="_blank">Link to file</a>
Any lead will be highly appreciated.
Thanks
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2019 06:27 AM
Hi Audrey,
Thanks for your inputs.
I followed the instruction and added "file" into HTMLSanitizerConfig. Now, I am using the below syntax in my email script.
template.print('<a href="file://servername/folderX/file.vbs "target="_blank">Link to file</a>');
Although I can see that this holds the correct path, it still does not redirect to a new browser window. Any suggestion?
Regards,
Debanjana

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2019 01:32 PM
Hi Debanjana,
I found a way to do it but only with an extension installed in my navigator.
name of extension : "Autoriser l'accès aux fichiers locaux"
Google Chrome (or Firefox) don't allow you to open a local file from your web browser (may it works if you receive mail in local mail application, I can't test this)
You have here some additional informations about a Chrome parameter which can (may be) allow you to open file from web browser : https://stackoverflow.com/questions/18586921/how-to-launch-html-using-chrome-at-allow-file-access-fr...
Regards,
Audrey Deruere
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2019 02:38 AM
Hi Audrey,
Thanks for the recommendation.
When I try to access the file in Chrome, it opens. I can go to the specific path and find the file.
But when this is embedded into the notification script, it does not redirect user to that.
We are using Outlook as mail application. The requirement is to hyperlink the file location into a notification email triggered by servicenow.
Are you suggesting that, it is not feasible without installing extensions? User can not even open the file location?
I appreciate your help!
Regards,
Debanjana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2019 01:54 AM
Hi Audrey,
I'm trying to hyperlink a file path in Knowledge article, added this line " urlAttributes: { "protocols" : [ "file", "notes" ] }," under HTML_WHITELIST Class in the script include but still the file doesn't open through the article however if I copy paste the URL it gets downlaoded.
Can you please suggest something here, any help is greatly appreciated!
Ankita

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2019 01:29 PM
Can you try
<a href="file:///servername\folderX\file.vbs" target="_blank">Link to file</a>
Please mark this response as correct or helpful if it assisted you with your question.