Facing corrupted file while downloading copied attachment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2025 08:54 AM
Hi Everyone,
We have a Business rule which copy the attachments from RITM to SCTask using the 'GlideSysAttachment'. Users are able to download the file from the RITM but facing issues when try to download copy of same file from SCTask. The downloaded file from SCTask has 0KB size and when open it, it's showing 'Failed to load PDF document' on chrome and 'Something went wrong' on the edge. I checked the sys_attachment table and and both the attachments on RITM and SCTask have same size bytes, status and size compressed details. Could anyone please help?
Thanks,
Shubhali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2025 03:07 PM
Hello @Sinha_Shubhali !
Could you please share the code from the Business Rule that's handling the attachment copy? That will help us troubleshoot the issue more effectively.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2025 02:51 AM
Hi @iekosmadakis,
Thanks for the response. This is the code of the BR. It's an after BR with order 100 and table is 'sc_task'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2025 01:33 AM
@Sinha_Shubhali wrote:Hi Everyone,
We have a Business rule which copy the attachments from RITM to SCTask using the 'GlideSysAttachment'. Users are able to download the file from the RITM but facing issues when try to download copy of same file from SCTask. The downloaded file from SCTask has 0KB size and when open it, it's showing 'Failed to load PDF document' on chrome and 'Something went wrong' on the edge. I checked the sys_attachment table and and both the attachments on RITM and SCTask have same size bytes, status and size compressed details. Could anyone please help?
Thanks,
Shubhali
It looks like the attachments aren't copying correctly using GlideSysAttachment. Even though the file sizes match in sys_attachment, the copied file from SCTask is unreadable. Possible causes include encoding issues, MIME type mismatches, security restrictions, or incorrect API usage. You could try alternative copying methods like AttachmentCreator with ecc_queue. Checking system properties related to file handling might also help.