Base64 Expressions

Overview

Provides simple Base64 functions intended for use on SAIL interfaces:

Key Features & Functionality

  • decodeSimpleBase64(text) - decode a base64 string. Max length 150 characters.
  • encodeSimpleBase64(text) - encode a base64 string. Max length 150 characters.
  • decodeHexString(text) - decode a hex string
  • hex2base64(text) - converts hex encoded string to base64encoded string
Anonymous
Parents
  • We are trying to integrate with a client's external system to send notifications. One of the input parameters of this system is "singleMessage" which is of type text and must be passed an XML converted to base64 with the email parameters (body, recipients, attachments, etc.). To convert the XML to Base64 I use the encodebase64string function (attached screenshot of the code), but this function corrupts the file. I also attach the request sent to the system and the resulting email (with the corrupt document).

    Could you help me?

  • Hi,

    This function is limited to 150 characters. You must update and recompile the plugin if you want to extend this limitation.

  • You are right, it is not a problem of limitation. It seem the limitation is now more than 150 chars.

    When I decode your base64, I can see "[Document:9399]" in your message. It is probably not you want.

    You try to put the document content by just setting fv!item. It cannot work.

    You must read the file content.and put the result inside. You can use the function readtextfromfile that is provided by the plugin Text File Utilities.

    The XML itself seem well formatted. I don't see any XML syntax error.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><solicitudUnicoType xmlns:xsi="">www.w3.org/.../XMLSchema-instance" xmlns:sms="SMSBus" xmlns:email="email" xmlns:push="push">
    <solicitud>
    <envioObligado>EMAIL</envioObligado>
    <email>
    <email:solicitudEmail>
    <email:codigoPeticion>PRUEBAPRE123</email:codigoPeticion>
    <email:destinatarios emailUnico="S">
    <email:destinatario>lfprados@minsait.com</email:destinatario>
    </email:destinatarios>
    <email:plantilla codigo="TESORERIA-NOTIFICACION"/>
    <email:asunto>Prueba notificación cambio de estado</email:asunto>
    <email:cuerpo>Estimado usuario,&lt;br&gt;&lt;br&gt;Se le informa de que la solicitud &lt;b&gt;00000001&lt;/b&gt; se encuentra en estado &lt;i&gt;'Autorizado, pendiente de validaci&amp;oacute;n'&lt;/i&gt;. Acceda al Portal en el siguiente enlace: &lt;br&gt;&lt;br&gt;csect-dev.appiancloud.com/.../design&lt;br&gt;&lt;br&gt;Un saludo.</email:cuerpo>
    <email:adjuntos>
    <email:adjunto id="idEjemplo" nombre="Prueba - copia - copia.pdf" extension="pdf">[Document:9399]</email:adjunto>
    </email:adjuntos>
    </email:solicitudEmail>
    </email>
    </solicitud>
    </solicitudUnicoType>

Comment
  • You are right, it is not a problem of limitation. It seem the limitation is now more than 150 chars.

    When I decode your base64, I can see "[Document:9399]" in your message. It is probably not you want.

    You try to put the document content by just setting fv!item. It cannot work.

    You must read the file content.and put the result inside. You can use the function readtextfromfile that is provided by the plugin Text File Utilities.

    The XML itself seem well formatted. I don't see any XML syntax error.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><solicitudUnicoType xmlns:xsi="">www.w3.org/.../XMLSchema-instance" xmlns:sms="SMSBus" xmlns:email="email" xmlns:push="push">
    <solicitud>
    <envioObligado>EMAIL</envioObligado>
    <email>
    <email:solicitudEmail>
    <email:codigoPeticion>PRUEBAPRE123</email:codigoPeticion>
    <email:destinatarios emailUnico="S">
    <email:destinatario>lfprados@minsait.com</email:destinatario>
    </email:destinatarios>
    <email:plantilla codigo="TESORERIA-NOTIFICACION"/>
    <email:asunto>Prueba notificación cambio de estado</email:asunto>
    <email:cuerpo>Estimado usuario,&lt;br&gt;&lt;br&gt;Se le informa de que la solicitud &lt;b&gt;00000001&lt;/b&gt; se encuentra en estado &lt;i&gt;'Autorizado, pendiente de validaci&amp;oacute;n'&lt;/i&gt;. Acceda al Portal en el siguiente enlace: &lt;br&gt;&lt;br&gt;csect-dev.appiancloud.com/.../design&lt;br&gt;&lt;br&gt;Un saludo.</email:cuerpo>
    <email:adjuntos>
    <email:adjunto id="idEjemplo" nombre="Prueba - copia - copia.pdf" extension="pdf">[Document:9399]</email:adjunto>
    </email:adjuntos>
    </email:solicitudEmail>
    </email>
    </solicitud>
    </solicitudUnicoType>

Children
No Data