<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Why is GlideSysAttachment.getContentBase64() documented, but not defined? in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/why-is-glidesysattachment-getcontentbase64-documented-but-not/m-p/2007213#M664139</link>
    <description>&lt;P&gt;I am pretty confused about this matter... I need to get the Base64 content of an attachment, so I went to the documentation and it recommends to use the function GlideSysAttachment.getContentBase64(): &lt;A title="eveloper.servicenow.com/app.do#!/api_doc?v=geneva&amp;amp;id=r_SGSA-getContentBase64_GR" href="https://developer.servicenow.com/app.do#!/api_doc?v=geneva&amp;amp;id=r_SGSA-getContentBase64_GR"&gt;https://developer.servicenow.com/app.do#!/api_doc?v=geneva&amp;amp;id=r_SGSA-getContentBase64_GR&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Though that function just does not exist in the system? It always keep popping up undefined...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run:&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14901736214419114 jive_text_macro" data-renderedposition="133.4517059326172_7.997159004211426_1192_139" jivemacro_uid="_14901736214419114" modifiedtitle="true"&gt;&lt;P&gt;&lt;SPAN style="color: #717171; font-family: SourceSansPro, Helvetica, Arial, sans-serif;"&gt;var sa = new GlideSysAttachment(); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #717171; font-family: SourceSansPro, Helvetica, Arial, sans-serif;"&gt;gs.prin&lt;/SPAN&gt;&lt;SPAN style="color: #717171; font-family: SourceSansPro, Helvetica, Arial, sans-serif;"&gt;t(typeof sa.getContentBase64); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #717171; font-family: SourceSansPro, Helvetica, Arial, sans-serif;"&gt;var a = []; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #717171; font-family: SourceSansPro, Helvetica, Arial, sans-serif;"&gt;for (var x in sa) { &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #717171; font-family: SourceSansPro, Helvetica, Arial, sans-serif;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; a.push(x); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #717171; font-family: SourceSansPro, Helvetica, Arial, sans-serif;"&gt;} &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #717171; font-family: SourceSansPro, Helvetica, Arial, sans-serif;"&gt;a.sort(); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #717171; font-family: SourceSansPro, Helvetica, Arial, sans-serif;"&gt;gs.print('\n'+a.join('\n'));&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the following output, which does not contain the function I need... So why is it not there, while it is in the documentation? I tried this on Geneva, Helsinki and Istanbul...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*** Script: undefined&lt;/P&gt;&lt;P&gt;*** Script:&lt;/P&gt;&lt;P&gt;DBImageAttachmentRecord&lt;/P&gt;&lt;P&gt;addEncryptionContexts&lt;/P&gt;&lt;P&gt;allAttachments&lt;/P&gt;&lt;P&gt;asStream&lt;/P&gt;&lt;P&gt;attachmentRecord&lt;/P&gt;&lt;P&gt;attachments&lt;/P&gt;&lt;P&gt;attachmentsForExtensions&lt;/P&gt;&lt;P&gt;bytes&lt;/P&gt;&lt;P&gt;bytesUnsafe&lt;/P&gt;&lt;P&gt;canRead&lt;/P&gt;&lt;P&gt;changeEncryptionContext&lt;/P&gt;&lt;P&gt;class&lt;/P&gt;&lt;P&gt;contentStream&lt;/P&gt;&lt;P&gt;contentType&lt;/P&gt;&lt;P&gt;delete&lt;/P&gt;&lt;P&gt;deleteAll&lt;/P&gt;&lt;P&gt;deleteAllAttachments&lt;/P&gt;&lt;P&gt;deleteAttachment&lt;/P&gt;&lt;P&gt;equals&lt;/P&gt;&lt;P&gt;errorFileName&lt;/P&gt;&lt;P&gt;errorMessage&lt;/P&gt;&lt;P&gt;exists&lt;/P&gt;&lt;P&gt;fileDescriptor&lt;/P&gt;&lt;P&gt;fileName&lt;/P&gt;&lt;P&gt;fixImageDimensions&lt;/P&gt;&lt;P&gt;get&lt;/P&gt;&lt;P&gt;getAllAttachments&lt;/P&gt;&lt;P&gt;getAsStream&lt;/P&gt;&lt;P&gt;getAttachmentRecord&lt;/P&gt;&lt;P&gt;getAttachments&lt;/P&gt;&lt;P&gt;getAttachmentsForExtensions&lt;/P&gt;&lt;P&gt;getBytes&lt;/P&gt;&lt;P&gt;getBytesUnsafe&lt;/P&gt;&lt;P&gt;getClass&lt;/P&gt;&lt;P&gt;getContentStream&lt;/P&gt;&lt;P&gt;getContentType&lt;/P&gt;&lt;P&gt;getDBImageAttachmentRecord&lt;/P&gt;&lt;P&gt;getErrorFileName&lt;/P&gt;&lt;P&gt;getErrorMessage&lt;/P&gt;&lt;P&gt;getFileDescriptor&lt;/P&gt;&lt;P&gt;getFileName&lt;/P&gt;&lt;P&gt;getInputStream&lt;/P&gt;&lt;P&gt;getParameter&lt;/P&gt;&lt;P&gt;getParameters&lt;/P&gt;&lt;P&gt;getSizeBytes&lt;/P&gt;&lt;P&gt;getSysID&lt;/P&gt;&lt;P&gt;getTableName&lt;/P&gt;&lt;P&gt;getTableSysID&lt;/P&gt;&lt;P&gt;hashCode&lt;/P&gt;&lt;P&gt;imageDimensions&lt;/P&gt;&lt;P&gt;inputStream&lt;/P&gt;&lt;P&gt;loadParameters&lt;/P&gt;&lt;P&gt;notify&lt;/P&gt;&lt;P&gt;notifyAll&lt;/P&gt;&lt;P&gt;parameter&lt;/P&gt;&lt;P&gt;parameters&lt;/P&gt;&lt;P&gt;processRequest&lt;/P&gt;&lt;P&gt;read&lt;/P&gt;&lt;P&gt;readByName&lt;/P&gt;&lt;P&gt;readToFile&lt;/P&gt;&lt;P&gt;renameAttachment&lt;/P&gt;&lt;P&gt;replaceContent&lt;/P&gt;&lt;P&gt;setContentType&lt;/P&gt;&lt;P&gt;setFileName&lt;/P&gt;&lt;P&gt;setImageDimensions&lt;/P&gt;&lt;P&gt;setInputStream&lt;/P&gt;&lt;P&gt;setStreamCipher&lt;/P&gt;&lt;P&gt;setStreamMonitor&lt;/P&gt;&lt;P&gt;setTableName&lt;/P&gt;&lt;P&gt;setTableSysID&lt;/P&gt;&lt;P&gt;sizeBytes&lt;/P&gt;&lt;P&gt;streamCipher&lt;/P&gt;&lt;P&gt;streamData&lt;/P&gt;&lt;P&gt;streamMonitor&lt;/P&gt;&lt;P&gt;sysID&lt;/P&gt;&lt;P&gt;tableName&lt;/P&gt;&lt;P&gt;tableSysID&lt;/P&gt;&lt;P&gt;toString&lt;/P&gt;&lt;P&gt;wait&lt;/P&gt;&lt;P&gt;write&lt;/P&gt;&lt;P&gt;writeContentStream&lt;/P&gt;&lt;P&gt;writeFromRequest&lt;/P&gt;&lt;P&gt;writeInvisible&lt;/P&gt;&lt;P&gt;writeParts&lt;/P&gt;</description>
    <pubDate>Wed, 22 Mar 2017 09:08:14 GMT</pubDate>
    <dc:creator>peterraeves</dc:creator>
    <dc:date>2017-03-22T09:08:14Z</dc:date>
    <item>
      <title>Why is GlideSysAttachment.getContentBase64() documented, but not defined?</title>
      <link>https://www.servicenow.com/community/developer-forum/why-is-glidesysattachment-getcontentbase64-documented-but-not/m-p/2007213#M664139</link>
      <description>&lt;P&gt;I am pretty confused about this matter... I need to get the Base64 content of an attachment, so I went to the documentation and it recommends to use the function GlideSysAttachment.getContentBase64(): &lt;A title="eveloper.servicenow.com/app.do#!/api_doc?v=geneva&amp;amp;id=r_SGSA-getContentBase64_GR" href="https://developer.servicenow.com/app.do#!/api_doc?v=geneva&amp;amp;id=r_SGSA-getContentBase64_GR"&gt;https://developer.servicenow.com/app.do#!/api_doc?v=geneva&amp;amp;id=r_SGSA-getContentBase64_GR&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Though that function just does not exist in the system? It always keep popping up undefined...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run:&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14901736214419114 jive_text_macro" data-renderedposition="133.4517059326172_7.997159004211426_1192_139" jivemacro_uid="_14901736214419114" modifiedtitle="true"&gt;&lt;P&gt;&lt;SPAN style="color: #717171; font-family: SourceSansPro, Helvetica, Arial, sans-serif;"&gt;var sa = new GlideSysAttachment(); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #717171; font-family: SourceSansPro, Helvetica, Arial, sans-serif;"&gt;gs.prin&lt;/SPAN&gt;&lt;SPAN style="color: #717171; font-family: SourceSansPro, Helvetica, Arial, sans-serif;"&gt;t(typeof sa.getContentBase64); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #717171; font-family: SourceSansPro, Helvetica, Arial, sans-serif;"&gt;var a = []; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #717171; font-family: SourceSansPro, Helvetica, Arial, sans-serif;"&gt;for (var x in sa) { &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #717171; font-family: SourceSansPro, Helvetica, Arial, sans-serif;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; a.push(x); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #717171; font-family: SourceSansPro, Helvetica, Arial, sans-serif;"&gt;} &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #717171; font-family: SourceSansPro, Helvetica, Arial, sans-serif;"&gt;a.sort(); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #717171; font-family: SourceSansPro, Helvetica, Arial, sans-serif;"&gt;gs.print('\n'+a.join('\n'));&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the following output, which does not contain the function I need... So why is it not there, while it is in the documentation? I tried this on Geneva, Helsinki and Istanbul...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*** Script: undefined&lt;/P&gt;&lt;P&gt;*** Script:&lt;/P&gt;&lt;P&gt;DBImageAttachmentRecord&lt;/P&gt;&lt;P&gt;addEncryptionContexts&lt;/P&gt;&lt;P&gt;allAttachments&lt;/P&gt;&lt;P&gt;asStream&lt;/P&gt;&lt;P&gt;attachmentRecord&lt;/P&gt;&lt;P&gt;attachments&lt;/P&gt;&lt;P&gt;attachmentsForExtensions&lt;/P&gt;&lt;P&gt;bytes&lt;/P&gt;&lt;P&gt;bytesUnsafe&lt;/P&gt;&lt;P&gt;canRead&lt;/P&gt;&lt;P&gt;changeEncryptionContext&lt;/P&gt;&lt;P&gt;class&lt;/P&gt;&lt;P&gt;contentStream&lt;/P&gt;&lt;P&gt;contentType&lt;/P&gt;&lt;P&gt;delete&lt;/P&gt;&lt;P&gt;deleteAll&lt;/P&gt;&lt;P&gt;deleteAllAttachments&lt;/P&gt;&lt;P&gt;deleteAttachment&lt;/P&gt;&lt;P&gt;equals&lt;/P&gt;&lt;P&gt;errorFileName&lt;/P&gt;&lt;P&gt;errorMessage&lt;/P&gt;&lt;P&gt;exists&lt;/P&gt;&lt;P&gt;fileDescriptor&lt;/P&gt;&lt;P&gt;fileName&lt;/P&gt;&lt;P&gt;fixImageDimensions&lt;/P&gt;&lt;P&gt;get&lt;/P&gt;&lt;P&gt;getAllAttachments&lt;/P&gt;&lt;P&gt;getAsStream&lt;/P&gt;&lt;P&gt;getAttachmentRecord&lt;/P&gt;&lt;P&gt;getAttachments&lt;/P&gt;&lt;P&gt;getAttachmentsForExtensions&lt;/P&gt;&lt;P&gt;getBytes&lt;/P&gt;&lt;P&gt;getBytesUnsafe&lt;/P&gt;&lt;P&gt;getClass&lt;/P&gt;&lt;P&gt;getContentStream&lt;/P&gt;&lt;P&gt;getContentType&lt;/P&gt;&lt;P&gt;getDBImageAttachmentRecord&lt;/P&gt;&lt;P&gt;getErrorFileName&lt;/P&gt;&lt;P&gt;getErrorMessage&lt;/P&gt;&lt;P&gt;getFileDescriptor&lt;/P&gt;&lt;P&gt;getFileName&lt;/P&gt;&lt;P&gt;getInputStream&lt;/P&gt;&lt;P&gt;getParameter&lt;/P&gt;&lt;P&gt;getParameters&lt;/P&gt;&lt;P&gt;getSizeBytes&lt;/P&gt;&lt;P&gt;getSysID&lt;/P&gt;&lt;P&gt;getTableName&lt;/P&gt;&lt;P&gt;getTableSysID&lt;/P&gt;&lt;P&gt;hashCode&lt;/P&gt;&lt;P&gt;imageDimensions&lt;/P&gt;&lt;P&gt;inputStream&lt;/P&gt;&lt;P&gt;loadParameters&lt;/P&gt;&lt;P&gt;notify&lt;/P&gt;&lt;P&gt;notifyAll&lt;/P&gt;&lt;P&gt;parameter&lt;/P&gt;&lt;P&gt;parameters&lt;/P&gt;&lt;P&gt;processRequest&lt;/P&gt;&lt;P&gt;read&lt;/P&gt;&lt;P&gt;readByName&lt;/P&gt;&lt;P&gt;readToFile&lt;/P&gt;&lt;P&gt;renameAttachment&lt;/P&gt;&lt;P&gt;replaceContent&lt;/P&gt;&lt;P&gt;setContentType&lt;/P&gt;&lt;P&gt;setFileName&lt;/P&gt;&lt;P&gt;setImageDimensions&lt;/P&gt;&lt;P&gt;setInputStream&lt;/P&gt;&lt;P&gt;setStreamCipher&lt;/P&gt;&lt;P&gt;setStreamMonitor&lt;/P&gt;&lt;P&gt;setTableName&lt;/P&gt;&lt;P&gt;setTableSysID&lt;/P&gt;&lt;P&gt;sizeBytes&lt;/P&gt;&lt;P&gt;streamCipher&lt;/P&gt;&lt;P&gt;streamData&lt;/P&gt;&lt;P&gt;streamMonitor&lt;/P&gt;&lt;P&gt;sysID&lt;/P&gt;&lt;P&gt;tableName&lt;/P&gt;&lt;P&gt;tableSysID&lt;/P&gt;&lt;P&gt;toString&lt;/P&gt;&lt;P&gt;wait&lt;/P&gt;&lt;P&gt;write&lt;/P&gt;&lt;P&gt;writeContentStream&lt;/P&gt;&lt;P&gt;writeFromRequest&lt;/P&gt;&lt;P&gt;writeInvisible&lt;/P&gt;&lt;P&gt;writeParts&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 09:08:14 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/why-is-glidesysattachment-getcontentbase64-documented-but-not/m-p/2007213#M664139</guid>
      <dc:creator>peterraeves</dc:creator>
      <dc:date>2017-03-22T09:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why is GlideSysAttachment.getContentBase64() documented, but not defined?</title>
      <link>https://www.servicenow.com/community/developer-forum/why-is-glidesysattachment-getcontentbase64-documented-but-not/m-p/2007214#M664140</link>
      <description>&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Have you missed the parenthesis?&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f6f6f6;"&gt;gs.print(&lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #006699; background-color: #f6f6f6;"&gt;typeof&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000; background-color: #f6f6f6;"&gt; sa.getContentBase64&lt;STRONG&gt;()&lt;/STRONG&gt;); &lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Please Hit like, Helpful or Correct depending on the impact of the response&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 22 Mar 2017 09:16:31 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/why-is-glidesysattachment-getcontentbase64-documented-but-not/m-p/2007214#M664140</guid>
      <dc:creator>Alikutty A</dc:creator>
      <dc:date>2017-03-22T09:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why is GlideSysAttachment.getContentBase64() documented, but not defined?</title>
      <link>https://www.servicenow.com/community/developer-forum/why-is-glidesysattachment-getcontentbase64-documented-but-not/m-p/2007215#M664141</link>
      <description>&lt;P&gt;Not really... I do not want to evaluate the function. I just want to check it exists&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 22 Mar 2017 09:38:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/why-is-glidesysattachment-getcontentbase64-documented-but-not/m-p/2007215#M664141</guid>
      <dc:creator>peterraeves</dc:creator>
      <dc:date>2017-03-22T09:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Why is GlideSysAttachment.getContentBase64() documented, but not defined?</title>
      <link>https://www.servicenow.com/community/developer-forum/why-is-glidesysattachment-getcontentbase64-documented-but-not/m-p/2007216#M664142</link>
      <description>&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;You've linked to the documentation for the scoped API, but the use of gs.print() in your code suggests you're working in the global scope. I believe getContent and getContentBase64 are only available in scoped apps while you have to use getBytes in the global scope. &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 22 Mar 2017 13:40:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/why-is-glidesysattachment-getcontentbase64-documented-but-not/m-p/2007216#M664142</guid>
      <dc:creator>Brad Tilton</dc:creator>
      <dc:date>2017-03-22T13:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: Why is GlideSysAttachment.getContentBase64() documented, but not defined?</title>
      <link>https://www.servicenow.com/community/developer-forum/why-is-glidesysattachment-getcontentbase64-documented-but-not/m-p/2007217#M664143</link>
      <description>&lt;P&gt;I'm working on Incident, so yes it will be in the global scope. Though getBytes only returns 5MB and not the full size, so that would not work either.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 22 Mar 2017 14:32:42 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/why-is-glidesysattachment-getcontentbase64-documented-but-not/m-p/2007217#M664143</guid>
      <dc:creator>peterraeves</dc:creator>
      <dc:date>2017-03-22T14:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: Why is GlideSysAttachment.getContentBase64() documented, but not defined?</title>
      <link>https://www.servicenow.com/community/developer-forum/why-is-glidesysattachment-getcontentbase64-documented-but-not/m-p/2007218#M664144</link>
      <description>&lt;P&gt;Hello Peter,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Were you able to figure that out or an alternate method to get the base64 encoding?&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Probir&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 31 May 2017 20:20:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/why-is-glidesysattachment-getcontentbase64-documented-but-not/m-p/2007218#M664144</guid>
      <dc:creator>ProbirDas</dc:creator>
      <dc:date>2017-05-31T20:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Why is GlideSysAttachment.getContentBase64() documented, but not defined?</title>
      <link>https://www.servicenow.com/community/developer-forum/why-is-glidesysattachment-getcontentbase64-documented-but-not/m-p/2007219#M664145</link>
      <description>&lt;P&gt;This is what we do now&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="_jivemacro_uid_14963077525948193 jive_macro_code jive_text_macro" data-renderedposition="50_8_1192_64" jivemacro_uid="_14963077525948193"&gt;&lt;P&gt;var attachmentIS = new GlideSysAttachmentInputStream(attachment.getValue('sys_id'));&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var bytearrayOS = new Packages.java.io.ByteArrayOutputStream();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; attachmentIS.writeTo(bytearrayOS);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var content64 = GlideBase64.encode(bytearrayOS.toByteArray());&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Though we have had JavaException with large attachments as the content64 was not large enough to contain the content of the file. As it was a JavaException and not a Javascript exception, it was also impossible to catch and log. So it's a good workaround for now, but we did not find time to find a better solution.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Jun 2017 09:04:53 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/why-is-glidesysattachment-getcontentbase64-documented-but-not/m-p/2007219#M664145</guid>
      <dc:creator>peterraeves</dc:creator>
      <dc:date>2017-06-01T09:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why is GlideSysAttachment.getContentBase64() documented, but not defined?</title>
      <link>https://www.servicenow.com/community/developer-forum/why-is-glidesysattachment-getcontentbase64-documented-but-not/m-p/2007220#M664146</link>
      <description>&lt;P&gt;Thanks for the code snippet peterraeves, that's put me on the right track!&lt;/P&gt;
&lt;P&gt;Turns out you can use GlideBase64.encode() on a&amp;nbsp;GlideSysAttachment byte array / stream / whatever it is in the background.&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;var gsa = new GlideSysAttachment();
var attachmentContentBase64 = GlideBase64.encode(gsa.getBytes(grAttachment));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Sep 2019 23:01:14 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/why-is-glidesysattachment-getcontentbase64-documented-but-not/m-p/2007220#M664146</guid>
      <dc:creator>davidmcdonald</dc:creator>
      <dc:date>2019-09-17T23:01:14Z</dc:date>
    </item>
  </channel>
</rss>

