- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2019 10:19 PM
Hi SN community,
We have a SOAP based integration with a third party system where we will be sending the large attachments >5mb through the webService call to the third party system. I am using GlideStringUtil.base64Encode to convert the attachments to base64encode string, any attachments >5MB are not getting converted to string.
Is there any other way I can achieve converting large files to base64 encoded string?
Any suggestion/recommendations would be appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2019 01:45 AM
Hi,
I think for more than 5mb file base64encoded data is difficult to get; try checking below script whether it works; gr is the gliderecord object of sys_attachment table
var StringUtil = new GlideStringUtil();
var gsis = GlideSysAttachmentInputStream(gr.sys_id.toString());
var ba = new Packages.java.io.ByteArrayOutputStream();
gsis.writeTo(ba);
baos.close();
var base64EncodedData = StringUtil.base64Encode(ba.toByteArray());
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
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
01-16-2020 10:06 AM
I had a problem in the SOAP payload request size if my attachments are bigger than 15MB, basically the payload is getting truncated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2020 07:13 AM
Hi RG, did you find any solution? I got the same issue...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2020 11:24 PM
Hi Nicolancl,
Not at this moment, we restricted the users not to attach more than 15MB on the incident table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2020 12:02 AM
Thank you for answering.
Are there any workaround? Unable to find anywhere. I need to SEND attachments >15mb to MIDServer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2021 04:23 AM
Just wanted to add, that the maximun attachment size that the system will return a base64 encoding for is controlled by com.glide.attachment.max_get_size property.
If the setting does not exist it will default to maximum 5 MB.
You can change this standard value as per your need. However, as mentioned in the following KB, this may cause some issues.
https://hi.service-now.com/kb_view.do?sysparm_article=KB0683260