ServiceNow Secure Attachment – Large Image Downloaded as Corrupted File
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
18 hours ago
Hi everyone,
We are facing an issue with ServiceNow Secure Attachment download.
Issue
* File upload is working successfully and the attachment record is created.
* Large/high-quality images are getting corrupted during download.
* The same image works correctly when reduced to around 300–500 KB.
* The issue is observed through the attachment download flow in both Native UI and Portal.
Current Download Flow
Client Script / UI Page / Portal Widget → SecureAttachmentUtil Script Include → Azure/SAS → File Download
The main backend download logic is handled in the SecureAttachmentUtil Script Include.
Could someone advise on the correct way to handle large binary attachments returned from Azure/SAS in ServiceNow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
16 hours ago
Hi @salemrajpau ,
I would check a few things :
1. Avoid using .toString() or parse binary response bodies as standard JavaScript strings this actually corructs the sequences above 300 KB.
2. Would check both the sys_attachment and sys_attachment_doc table if something is being missed or some user might not have access .
Sandeep Dutta
Please mark the answer correct & Helpful, if i could help you.