Knowledge Article attachments are downloaded instead of opening in the browser. How can I change this behavior?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-02-2021 11:09 AM
Knowledge Article attachments are downloaded instead of opening in the browser. How can I change this behavior?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-02-2021 11:33 AM
Hi, Abhinav!
You can code attachments as URLs instead of as attachments using either the link tool within your content tools or using the HTML coding in the source code.
Please see the attached PDF resource. (Some of it is a bit specific to our organization, but the steps for the hack I found work. You'll find directions for both ways - as an attachment and as a URL.)
Also, please see this thread I participated in not too long ago. There's some additional info here that might help.
If you find this info and this guide helpful (or even correct for your needs), please mark my answer as such so others will know it's legit. š
Good luck! Please let me know if you have additional questions!
Lauren
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-03-2021 10:06 AM
Hello Lauren,
Thanks for the workaround. It may work when we create a new KB article. But we already have thousands of KB articles and some of these articles have attachment. Kindly check my reply in the response below that we don't want attachment to be downloaded but opens in the browser.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-03-2021 11:08 AM
The only way I know to fix all those links is to fix them in the HTML coding - either using the workarounds in the guide I attached or going straight into the code, depending on your coding skills.
The only other thing you might be able to try is writing and running your own script to make mass changes across articles. We've not tried this in the content yet, so I don't know exactly how it would work, but it's worth looking into.
If you look at the URLs that are used for your attachments, they all have "attachment" in them and some other unique identifiers that separate them from regular URLs that link to other articles or websites.
You also have to make sure a document/PDF viewer is enabled in your instance. (I am not the admin for our group, so I don't know a lot more than that - someone else may be able to provide more details. I also posted about it in another thread early on. This link may provide some info: https://community.servicenow.com/community?id=community_question&sys_id=fbeff570db475c54fa192183ca96.... There is also more info in the comments to this article.)
In the meantime, when your document viewer is enabled, it automatically turns attachments into PDFs viewable in a web browser. When you have it coded right, the attachment URL will end with "&view=true".
That being the case, you may be able to run some sort of script with the logic that all URLs that contain "[whatever identifier makes the most sense for you for your current attachments]" > add "&view=true" to the end of the URL. In doing so, you may be able to change the coding en masse.
You could try customizing your knowledge article widget to default all attachment links to open in a new browser tab as a PDF, but I feel like long-term, that could come back to bite you.
Hope this gives you some ideas! Let me know if this leads you on the right path or not.
-Lauren

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-02-2021 12:07 PM
Hi Abhinav,
You want to ensure that Attachment Link is not checked in the Meta Data of the article. That tells the system that you want the attachment to automatically download when a user clicks on that article. Instead, you want to check Display Attachments which allows the user to read your article and be guided to open the attachment if needed.