Maximum file size to convert to base64 in servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2020 04:25 AM
What is the Maximum file size to convert to base64 in servicenow? i tried with 2MB and 3MB but it is not converting to base64. Please help me in this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2020 04:40 AM
Hi Ramesh,
I believe for 2MB or 3MB should be fine
for more than 5MB check this link:
https://community.servicenow.com/community?id=community_question&sys_id=6d6f7aaddbad4010d58ea345ca961977
There is some limit when it crosses 20MB; Can you try for 10MB, 15MB and 18/19MB files as well
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
02-04-2020 04:47 AM
i tried with 3MB but it showing empty.
var sa = new GlideSysAttachment();
var bytes = sa.getBytes(gr); //gr is my glide record object
var content64 = GlideStringUtil.base64Encode(bytes);
gs.info("Base64 Content64:" + content64);
log message: Base64 Content64:
it is giving empty output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2020 04:52 AM
Hi Ramesh,
Can you share the complete script here?
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
02-04-2020 05:26 AM
var gliObj = new GlideRecord('sys_attachment');
gliObj.addQuery('table_name', 'dms_document_revision');
gliObj.addQuery('table_sys_id', '405a9589db764890d17be1c2ca96197a');
gliObj.query();
gs.info('count' + gliObj.getRowCount());
while (gliObj._next()) {
var sa = new GlideSysAttachment();
var bytes = sa.getBytes(gliObj);
gs.info("Bytes: " + bytes);
var size = parseInt(gliObj.size_bytes);
gs.info("Bytes: " + size);
var content64 = GlideStringUtil.base64Encode(bytes);
gs.info("Base64 Content64:" + content64);
}