Why is the Excel attachment opening in document viewer and downloading as a PDF, not an Excel file?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 10:31 AM
We have an article with an Excel file attached. When a reader clicks on the attachment it is launching in the SNow document viewer rather than launching Excel. Then, if they attempt to download the file, it converts it to a PDF. We need it to be an actual Excel file. Is there a way to specify what types of files open with the document viewer?
One interesting note about this. In both the portal view and kb home view the attachment shows on the upper right and follows the above described behavior. However the user that brought this to me had a link to the article from a different source and the attachment showed at the bottom. When the attachment shows at the bottom and is clicked, it downloads an actual Excel file. I do still find it frustrating that after all these years there are so many different views that behave differently and don't have a consistent experience for the end users.
Portal link: https://xxxxxxxxx.service-now.com/sp?id=kb_article_view&sysparm_article=KB0015298
View (preview?) that shows attachment at the bottom: https://xxxxxxxxx.service-now.com/kb_view.do?sysparm_article=KB0015298
- Labels:
-
Knowledge Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 10:34 AM
Hi Kim,
Kindly refer the Servicenow article on this and the workaround.
Link - https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0813384
Regards,
Deepankar Mathur

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 03:05 PM
Thanks. This is good info, except we don't want to disable the document viewer. Is there a way that a script can be used to disable the document viewer only for Excel files? There should really be an option for each attachment to set the behavior. Do you want it visible as an attachment (actual attachments, yes. screenshots and images from the body of the article, probably not)? For some items the viewer is ok (specifically PDF's). Others we may want it to open in its native Application (Word/Excel) or perhaps we just want click to download and not have it open at all.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 10:41 AM
Hi,
From what I've found, documents can only pop open as a PDF in a PDF viewer - and then you can download them in their original format. (Even THIS is an improvement. Years ago, you couldn't get attachments in non-PDF form to show up/load at all. You could ONLY download them. So, at least you have an option now.)
Also, look at your coding in the backend. Look at the end of your URL and see if it includes "&view=true" after the sys_id for that attachment. That tells you it's going to load in a PDF viewer vs. downloading. Try deleting that code.
I hope this helps! Please mark as "helpful" or "correct" if it is - and please reply with any follow-up questions you have. Good luck! 🙂