GlideSysAttachment getContentstream not working for more than 5 mb attachments in Scoped Application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2020 06:38 PM
Hi,
We are using using below piece of code for reading excel attachment, its working for small attachments but not working for large attachment ( it seems more than 5mb). Global property attachment max size is set to 20mb.
var parser = new sn_impex.GlideExcelParser();
var attachment = new GlideSysAttachment();
var attachmentStream = attachment.getContentStream(sys_id); //sys_id of attachment
parser.setSheetName("Template");
parser.setHeaderRowNumber(-1);
parser.parse(attachmentStream);
while (parser.next() && i < 4) {
row = parser.getRow();
rows[i] = row;
i++;
Any other function we have to use for scoped apps?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2020 09:17 PM
Hi Manisha,
The property you are talking about is "com.glide.attachment.max_get_size"?
According to this post, increasing that value should work:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2020 10:04 PM
Hi Manisha,
this is the limitation for getContentStream() method it cannot give content beyond 5mb in scoped application OOB.
It is documented as well
I won't recommended changing any system property as workaround for this as it might lead to performance issue
refer below links for help
Has anyone increased com.glide.attachment.max_get_size?
How to read attachments with more than 5 MB size, in Scoped Application ?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2020 04:12 AM
Thank you all.
It worked by raising size of property - "glide.scriptable.excel.max_file_size"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2020 04:13 AM
Thank you all.
It woked by raising value of property- glide.scriptable.excel.max_file_size.