- 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
09-02-2024 05:56 AM
I am currently exploring the replacement of GlideEncrypter with GlideStringUtil.base64Decode in a script I am working on. The initial tests indicate that the replacement seems to function as expected. However, I want to ensure that this approach adheres to best practices and will not negatively impact the future performance or maintainability of our instance. Could you please confirm if this is a recommended practice, or if there are any potential concerns or alternative methods I should consider?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2020 04:49 AM
Hi Ankur,
This is not working for scoped application. Is there any way to do this in scoped app for files greater than 5 MB?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2020 05:00 AM
Hi Priya,
I doubt there exists anything for this currently in scoped app
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
08-30-2024 02:17 PM
I know this answer is from years ago, however, I cannot find documentation of the method you are using. Can you please share link?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2024 11:07 PM
The files are being sent but unable to open with the above script