how to upload the document in sys_attachement table with Table name as a "sys_attachement"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2017 11:26 PM
Hi Fiends
I have to upload the document in sys_attachement table with Table name as a "sys_attachement", But whenever i uploading the document it is stored in the sys_attachment table but with different table name, but i want the Table Name should be the "sys_attachement" (so that only i am able to download using HTML link)
how to upload the document in sys_attachement table with Table name as a "sys_attachement"
Please help me to resolve this issue
Thanks
Ramesh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2017 12:15 AM
I just added this in a UI page and it works fine.
<a href="/sys_attachment.do?sys_id=0d3d6c31dbbbb200d8ccd421cf9619a1" target="_blank">Attachment</a>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2017 12:39 AM
Still i am facing the same problem, is the table name is sys_attachment means it working fine other table means its not able to download.
can you please provide me the code which is you used..?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2017 12:49 AM
That is the single line of code that I added in a UI page and tested it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2017 11:48 PM
As kalai has already mentioned, changing the table name would not be the appropriate way to handle this. If you do not want the end users to see that attachment but still it has to reside with ServiceNow
1. If it is an image, go to Live feed and upload the image. The thumbnail of the uploaded image will be saved with table name as sys_attachment by default
2. From ServiceNow's Email client, upload the attachment and send it to yourself and it gets saved in sys_attachment table with table name = sys_email
But these will hide the attachment from the end user in terms of UI but still they can download the attachment if they know the whole link
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2017 01:57 AM
Dear Ramesh,
I used the exact script that you have provided(by updating the sys_id of the attachment record) and it worked ok for me on my personal dev, the attachment got downloaded fine as well. I used below query to get the sys_id of the attachment record as that field is not available on the list view
var gr = new GlideRecord('sys_attachment');
gr.query();
if(gr.next()){
gs.print(gr.sys_id);
}
output is shown below, I used this sys_id in my UI page script
UI page
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<p>Please attach the documents of Configuration Item in the attachments field</p>
<p><strong><font color="blue">Please download Template Form for Provisioning, </font> <a href="/sys_attachment.do?sys_id=003a3ef24ff1120031577d2ca310c74b" target="_blank"><font color="green"><u>Click Here</u></font></a><font color="blue"> to download form</font> </strong></p>
</j:jelly>
attachment record
Please let me know if you have any queries.
Thanks
Anil