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
Hello Ramesh,
Kindly check ths link for the size limits.
https://hi.service-now.com/kb_view.do?sysparm_article=KB0718101
Also, are you getting any error when converting to base64?
Mark the comment as a correct answer and helpful if it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2020 04:51 AM
I updated size limit with 2048 and i tried with 2MB file still facing issue.
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:59 AM
can you share the complete script.
- 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);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2020 05:55 AM
The script seems to be working fine.
are you getting the output of this line
gs.info("Bytes: " + bytes);