Open HTML type Attachments from a Knowledge Article in a new tab, instead of downloading it directly

madhuv
Tera Contributor

Hello forum,


We have a requirement to open HTML type Attachments from a Knowledge Article in a new tab, instead of downloading it directly. We tried a few things but it didn't worked. Also referred to the below article, it works for pdf's and ppt's but not for html files:


https://www.servicenow.com/community/hrsd-articles/open-attachments-on-knowledge-articles-in-a-new-…

 

We also tried with the UI Page and client Script combination (Attached are the script files for reference) as per the suggestion from ChatGPT, that also did not worked with some fine tunings as well. 

cc: @MahakG477595950 

2 REPLIES 2

Tanushree Maiti
Kilo Patron

1) Try with enabling  property (glide.knowman.use_document_viewer) and after that there will be a view button in front of attachments in Knowledge Article view.

OR

2) Using this tag

<a title="Test" href="<url of your doc>" target="_blank" >

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

Hi Tanu,

 

Thanks for the response. It opens the other file but not the htm or html extension files. they are still downloaded.