Attachment auto convert from any format to blob format
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2019 02:32 AM
Hi All,
I am trying to auto conversion of attachment file of any format to blob format in Service Portal form but I don't know how it could be done
Can Anyone help in this? It would be more helpful for me
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2019 02:46 AM
Hi Amit,
Please refer the following link for your reference.
https://stackoverflow.com/questions/33855167/convert-data-file-to-blob
https://developer.mozilla.org/en-US/docs/Web/API/FileReader
Please mark as helpful if this solution worked out for you!
Thanks,
Nishi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2019 02:46 AM
Hi Amit,
why you want to convert any format to BLOB?
What is the requirement here?
BLOB is a format used at SQL server level for large files.
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
07-22-2019 02:53 AM
Hello Ankur,
The requirement is to convert the attached files to blob so that we can save it in an oracle database
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2019 02:47 AM
Hello Amitkumar,
Checkout this link:
What I have used in my project is as below:
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
if (ignore != true && error != true )
{
var StringUtil = GlideStringUtil;
var attachment = new Attachment( );
attachment.write('incident',target.sys_id,source.u_attachment_name,'',StringUtil.base64DecodeAsBytes(source.u_attachement_file));
}
})(source, map, log, target);
Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade
Abhishek Gardade