Ankur Bawiskar
Tera Patron

Hi,

The first part of the code looks good i.e. getting base64encoded data for the attachment and sending it

the second part also looks good.

Is the file getting created correctly in the mid server folder? did you check the content. if the content is same then you should be good

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

The file is getting created in the correct location.  Looking at it in a text editor shows pieces of it are corrupted, though some characters appear to be fine.

find_real_file.png

Interestingly, text appears to make it through just fine.  I created a text file with normal English characters in it and a few high bit ASCII characters at the end.  The normal text came through just fine and the high bit stuff was mangled.  The correct version is on the right, corrupted on the left.

find_real_file.png

vkachineni
Mega Sage

What is the size of the attachment?

 

The documentation for the call

 

attachmentContents = sa.getContent(grSysAtt);

 

says The attachment contents as a string. Returns up to 5 MB of data.

 

Also what type of file attachment is it? Text,jpg, pdf?

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022

It's about 50K and it's a ZIP file that contains a .docx file.