Convert large file into base64 in scope application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2025 09:36 AM
Hello,
I am facing issue in rest API, where i need to send request record details with attachment to 3rd party. Attachment needs to send in base64 format. I am able to send attachment if file size less then 5 MB, but if file size is greater the 5 MB payload send empty key. I can't use GlideStringUtil() as this rest API is in scope application. How we can send large file in base64 format in scope application?
Appreciate your help!!!!
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2025 11:55 PM
I check the other links as well but its not working.
I have check with script include as well but it is giving me error with cross scope.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2025 12:39 AM
did you set Accessible from all scopes for your global script include?
then it should not give cross scope
share the script include config screenshots.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2025 01:08 AM
check This video
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2025 01:14 AM
I was able to get base64 encoded data of 6MB file using the approach I shared
Created script include in global scope, accessible from all scopes
Then invoked it
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2025 02:46 AM
Thanks for your time!!
I my case there are some file having 25+ MB size, so I took other approach where now i am sending URL of attachment in rest API.
Thanks