GlideSysAttachment getContentstream not working for more than 5 mb attachments in Scoped Application

Manisha17
Tera Contributor

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?

5 REPLIES 5

Willem
Giga Sage
Giga Sage

Hi Manisha,

The property you are talking about is "com.glide.attachment.max_get_size"?

According to this post, increasing that value should work:

https://community.servicenow.com/community?id=community_question&sys_id=a4321f21db101fc01dcaf3231f96...

Ankur Bawiskar
Tera Patron
Tera Patron

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 ?

find_real_file.png

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Manisha17
Tera Contributor

Thank you all.

It worked by raising size of property - "glide.scriptable.excel.max_file_size"

Manisha17
Tera Contributor

Thank you all.

It woked by raising value of property- glide.scriptable.excel.max_file_size.