Append data to an attachment without reloading it's large size content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2023 09:21 AM - edited 12-29-2023 09:24 AM
Hi community,
There is a situation where I need to process large chunks of data (coming from a web service) and write it to an attachment. The problem with GlideSysAttachment.write or GlideSysAttachment.writeContent is that it requires all the content at once and I believe that it will be too large to fit in memory (I don't have clues yet how large the data would be but I know it will be very).
Due to this, I wanted to know if it's possible to dump first page then programmatically append next pages to the existing attachment. I tried to add base64 data to to table sys_attachment_doc but that didn't work, also I searched the documentation and the only file stream class GlideScriptableInputStream/GlideTextReader provides only reading capabilities.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2023 09:27 AM
Hi there,
One of my friend had the same use case and I remember them implementing an external cloud storage service rather than storing it directly in ServiceNow.
Thanks,
Tushar