Maximum file size to convert to base64 in servicenow

Ramesh R
Tera Contributor

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.

21 REPLIES 21

asifnoor
Kilo Patron

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.

 

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.

can you share the complete script.

 

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);
}

The script seems to be working fine.

are you getting the output of this line

gs.info("Bytes: " + bytes);