How to hyperlink a file path (e.g: \\servername\folderX\file.vbs) into a notification email script?

Debanjana
Tera Contributor

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

13 REPLIES 13

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

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

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.

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

SanjivMeher
Kilo Patron
Kilo Patron

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.