Decode Base64(Pdf) to binary

Hi all,
I have a WS - PI - File scenario.
So I get a base64 coded PDF-File and have to create a decoded binary file.
First I used an UDF. But the created document is invalid and not to open by Acrobat. After reading the forum the conclusion is,  it is impossible to convert data in mapping step, is'nt it.
But what are the other possibilities?
Regards
Mathias

You can do this in the mapping using Base64.decode() method from SAP standard API (com.sap.aii.utilxi.base64.api.*)
Check my WIKI section for ref: [Sending Binary Data to Inbound Plain HTTP Adapter in XI and PI |http://wiki.sdn.sap.com/wiki/display/XI/SendingBinaryDatatoInboundPlainHTTPAdapterinXIand+PI] where i used encode method in HTTP client code.
You can check decode method code in the java snippet  "Java Mapping - Base64 Decryption and Unzipping Code "
Edited by: Praveen Gujjeti on Jul 16, 2010 4:59 PM

Similar Messages

  • Encode and Decode Base64

    Hi All,
    I need to Encode and Decode Base64 File. 
    Please let me know if there is any Function Modules or Class Methods to achieve the requirement.
    Thanks in advance.
    Regards
    Joseph
    Message was edited by: Joseph Brown

    Hi,
    This is the encoded base64 file in XML format:
    <?xml version="1.0" encoding="UTF-8"?>
    <Z_CREFO_DOC>
    <E_PDF><![CDATA[JVBERi0xLjMKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiAwIFIvRmlsdGVyIC9GbGF0ZURlY29k
    ZT4+CnN0cmVhbQp4nE2MPQ/CMAxEd/8Kj/aQEKehIWvFh8QElTfEVNFOGUr7/0UagcTd8vSkuxmd
    FY9u6wGDLs4rRA1dhfvvCeYIaDbbZU8c9Dxk7LMGG50RGkWsHobExpj7F1NjhBzfCgG5tAR/Z0
    5pYMN6Qs9OJACxuhlY0n5Kde4aRwL/0A6e4hnWVuZHN0cmVhbQplbmRvYmoKNiAwIG9iagoxMzEK
    ZW5kb2JqCjQgMCBvYmoKPDwvVHlwZS9QYWdlL01lZGlhQm94IFswIDAgNTk1LjIyIDg0Ml0KL1Jv
    dGF0ZSAwL1BhcmVudCAzIDAgUgovUmVzb3VyY2VzPDwvUHJvY1NldFsvUERGIC9UZXh0XQovRXh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wIG4gCjAwMDAwMDAyMzUgMDAwMDAgbiAKMDAwMDAwMDAxNSAwMDAwMCBuIAowMDAwMDAwMjE2
    IDAwMDAwIG4gCjAwMDAwMDA1MTQgMDAwMDAgbiAKMDAwMDAwMjE2MCAwMDAwMCBuIAowMDAwMDAx
    ODE3IDAwMDAwIG4gCjAwMDAwMDA1NTUgMDAwMDAgbiAKMDAwMDAwMDU4NSAwMDAwMCBuIAowMDAw
    MDAwNjE1IDAwMDAwIG4gCjAwMDAwMDE3OTYgMDAwMDAgbiAKdHJhaWxlcgo8PCAvU2l6ZSAxNCAv
    Um9vdCAxIDAgUiAvSW5mbyAyIDAgUgovSUQgWyityXEclVXSeoKdpGR5FFwppSkorclxHJVV0nqC
    naRkeRRcKaUpXQo+PgpzdGFydHhyZWYKMjU5NgolJUVPRgo=]]>
    </E_PDF>
    <C_ERROR></C_ERROR>
    </Z_CREFO_DOC>
    Can i pass all these characters or i need to transform it first, extract the value of the element and decode? Finally i need to write the decoded outcome to a file (a pdf file) to the hard drive (may be with: OPEN DATASET P_DATASET FOR INPUT IN TEXT MODE ENCODING DEFAULT)
    I saw this hint but I think there should be more to it (eg. transformation of the initial decoded xml file and the writing it to hard drive using the Open Dataset for Input...):
    ****************being of report *************************
    DATA: z       TYPE string,
          encode  TYPE string,
          decode  TYPE string .
    DATA: obj  TYPE REF TO cl_http_utility,
          cref TYPE REF TO if_http_utility.
    CREATE OBJECT : obj.
    cref = obj.
    z = 'what u have to encode'.
    encode = obj->if_http_utility~encode_base64( z ) .
    decode = obj->if_http_utility~decode_base64( encode ).
    ****************end of report ***************************
    What do i need more to the above report

  • How to convert pdf  to binary

    hi all,
       how to convert pdf  to binary .
    regards,
    sheetal

    refer this -
    http://www.geocities.com/rmtiwari/main.html?http://www.geocities.com/rmtiwari/Resources/MySolutions/Dev/Codes/Report/Z_RMTIWARI_XSTRING_TEXT_CONVER.html

  • Decode Base64 in 4.6c

    i need to decode base64 attachments.
    However the funciton modules i would normally use are not available in 4.6c does anyone know how i can do it ?

    I found a solution in 4.6C which works out of the box: (See form in s_trustmanager)
    *     Decode String
          PERFORM ssf_base64_decode IN PROGRAM s_trustmanager
                USING lv_char
                CHANGING lv_hex.

  • PDF to Binary

    Hi,
    I create a Adobe Interactive Form, I need to display this PDF in SAP portal, then I need to develop a RFC to return this PDF file, I read in other post that the way is to convert de PDF to binary file a return this binary file like a paremeter in the RFC.
    Someone have an example about this?
    Regards
    Eduardo Campos

    This works for me, it copies an excel file into another excel file.
    You can keep the binary information as long as you want and later download the file to another place.
    You can try it to see if it works for you.
    Remember to keep the file lenght.
    types: stringa(4096).
    data: tabla type standard table of stringa.
    DATA: FILE TYPE STRING.
    DATA: LENGHT TYPE I.
    fILE = 'C:\DOCUMENTS AND SETTINGS\myuser\MY DOCUMENTS\BOOK1.XLS'.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = FILE
       FILETYPE                      = 'BIN'
    *   HAS_FIELD_SEPARATOR           = ' '
    *   HEADER_LENGTH                 = 0
    *   READ_BY_LINE                  = 'X'
    *   DAT_MODE                      = ' '
    IMPORTING
       FILELENGTH                    = LENGHT
    *   HEADER                        =
      TABLES
        DATA_TAB                      = tabla.
    BREAK RJESCISL.
    fILE = 'C:\DOCUMENTS AND SETTINGS\myuser\MY DOCUMENTS\BOOK2.XLS'.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
       BIN_FILESIZE                  = LENGHT
        FILENAME                      = file
       FILETYPE                      = 'BIN'
    *   APPEND                        = ' '
    *   WRITE_FIELD_SEPARATOR         = ' '
    *   HEADER                        = '00'
    *   TRUNC_TRAILING_BLANKS         = ' '
    *   WRITE_LF                      = 'X'
    *   COL_SELECT                    = ' '
    *   COL_SELECT_MASK               = ' '
    *   DAT_MODE                      = ' '
    * IMPORTING
    *   FILELENGTH                    =
      TABLES
        DATA_TAB                      = TABLA
    EXCEPTIONS
       FILE_WRITE_ERROR              = 1
       NO_BATCH                      = 2
       GUI_REFUSE_FILETRANSFER       = 3
       INVALID_TYPE                  = 4
       NO_AUTHORITY                  = 5
       UNKNOWN_ERROR                 = 6
       HEADER_NOT_ALLOWED            = 7
       SEPARATOR_NOT_ALLOWED         = 8
       FILESIZE_NOT_ALLOWED          = 9
       HEADER_TOO_LONG               = 10
       DP_ERROR_CREATE               = 11
       DP_ERROR_SEND                 = 12
       DP_ERROR_WRITE                = 13
       UNKNOWN_DP_ERROR              = 14
       ACCESS_DENIED                 = 15
       DP_OUT_OF_MEMORY              = 16
       DISK_FULL                     = 17
       DP_TIMEOUT                    = 18
       FILE_NOT_FOUND                = 19
       DATAPROVIDER_EXCEPTION        = 20
       CONTROL_FLUSH_ERROR           = 21
       OTHERS                        = 22.
    Edit: Sorry, didn't read the question right.
    Well, is almost the same way, just use Open dataset dsn in binary mode. That way you'll get your file in binary mode.
    I was supossing you were usen a local file but now I see you want it in the application server
    Edited by: Ramiro Escamilla on Feb 29, 2008 10:11 PM

  • Decode Base64 and save as binary file

    Hi there,
    I am using Adobe Air 1.5 with JavaScript and want to save a file to my hard
    drive. I get the data from a WebService via SOAP as a Base64 encoded string. A test-string is attached. When I try to decode it with
    the WebKit function "atob()" and try to save this bytes with following code, I can't open the file.
    this.writeFile = function(outputfile, content, append){
    var file =a ir.File.applicationStorageDirectory.resolvePath(outputfile);
    var stream = newa ir.FileStream();
    if (append) {
    stream.open(filea, ir.FileMode.APPEND);
    }else {
    stream.open(filea, ir.FileMode.WRITE);
    try{//Binärdaten
    stream.writeBytes(content0, , content.length);
    }catch(e){//Textdaten
    stream.writeUTFBytes(content);
    stream.close();
    The same happens when I try to open a file from my HDD and read in the bytes. When I decode it to base64, the string is not equal to the string, which is correct.
    I attached a working Base64 string, which I could convert back to a zip-file via a only encoder.
    So my question is, how can I decode a Base64 string and save the binary data to a file?
    Thank you for your help.

    I rewrote the Base64 decoder/encoder to use it with a ByteArray. Here ist the code:
    var byteArrayToBase64 = function(byteArr){
        var base64s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
         var encOut = "";
        var bits;
        var i = 0;
        while(byteArr.length >= i+3){
            bits = (byteArr[i++] & 0xff) << 16 | (byteArr[i++] & 0xff) << 8 | byteArr[i++] & 0xff;
              encOut += base64s.charAt((bits & 0x00fc0000) >> 18) + base64s.charAt((bits & 0x0003f000) >> 12) + base64s.charAt((bits & 0x00000fc0) >> 6) + base64s.charAt((bits & 0x0000003f));
        if(byteArr.length-i > 0 && byteArr.length-i < 3){
            var dual = Boolean(byteArr.length - i - 1);
            bits = ((byteArr[i++] & 0xff) << 16) | (dual ? (byteArr[i] & 0xff) << 8 : 0);
            encOut += base64s.charAt((bits & 0x00fc0000) >> 18) + base64s.charAt((bits & 0x0003f000) >> 12) + (dual ? base64s.charAt((bits & 0x00000fc0) >> 6) : '=') + '=';
        return encOut;
    var base64ToByteArray = function(encStr){
        var base64s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
         var decOut = new air.ByteArray(); 
        var bits;
        for(var i = 0, j = 0; i<encStr.length; i += 4, j += 3){
            bits = (base64s.indexOf(encStr.charAt(i)) & 0xff) <<18 | (base64s.indexOf(encStr.charAt(i +1)) & 0xff) <<12 | (base64s.indexOf(encStr.charAt(i +2)) & 0xff) << 6 | base64s.indexOf(encStr.charAt(i +3)) & 0xff;
            decOut[j+0] = ((bits & 0xff0000) >> 16);
              if(i+4 != encStr.length || encStr.charCodeAt(encStr.length - 2) != 61){
                   decOut[j+1] = ((bits & 0xff00) >> 8);
              if(i+4 != encStr.length || encStr.charCodeAt(encStr.length - 1) != 61){
                   decOut[j+2] = (bits & 0xff);
        return decOut;

  • Possible to decode base64 document contents to XDP?

    Hi,
    As the title says, is it possible to decode the base64-encoded contents of my PDF back to an XDP format?
    Using this JavaScript SOAP.stringFromStream(SOAP.streamEncode(Collab.documentToStream(event.target), "base64")); I am able to submit the base64 encoded PDF document to my server side for processing. Is there any way to convert this back to XDP format at this stage?
    Thanks,
    Ray

    Maybe someone might have a few ideas on how I can approach my problem so.
    My web application maintains session info of any logged in users. One of the attributes of the session is a "securityToken".
    When the user clicks a button on the PDF within my web application, a Web Service call is made. However, I need to get the securityToken into this Web Service call. This securityToken isn't something that the user should be manually entering.
    Can anyone think of any possible solution to solve this problem?
    Thanks,
    Ray.

  • BASE64 (PDF) CLOB to BLOB

    Hello everybody! I have to convert a BASE64 representation of a PDF file to BLOB. I found one example on the Internet but there is something wrong with it and I can't figure it out.
    create or replace function decode_base64(p_clob_in in clob) return blob is
    v_blob           blob;
    v_offset         integer;
    v_buffer_varchar varchar2(32000);
    v_buffer_raw     raw(32000);
    v_buffer_size    binary_integer := 32000;
    begin
    if p_clob_in is null then
    return null;
    end if;
    dbms_lob.CREATETEMPORARY(v_blob, true);
    v_offset := 1;
    FOR i IN 1..CEIL(dbms_lob.GETLENGTH(p_clob_in) / v_buffer_size)
    loop
    dbms_lob.READ(p_clob_in, v_buffer_size, v_offset, v_buffer_varchar);
    v_buffer_raw := utl_encode.BASE64_DECODE(utl_raw.CAST_TO_RAW(v_buffer_varchar));*
    dbms_lob.WRITEAPPEND(v_blob, utl_raw.LENGTH(v_buffer_raw), v_buffer_raw);
    v_offset := v_offset v_buffer_size;+
    end loop;
    return v_blob;
    end decode_base64;
    The above procedure should work with files of any size (since there is a loop), but it only works when the PDF is smaller than 32 KB.

    Just a guess.
    You may have additional CRLFs added when encoding.
    Try this:
    create or replace function replaceClob (opCLob CLOB,cpReplaceStr VARCHAR2,cpReplaceWith VARCHAR2) RETURN CLOB IS
       cBuffer    VARCHAR2 (32767);
       nBuffer    BINARY_INTEGER := 32767;
       nStart     PLS_INTEGER := 1;
       nLen            PLS_INTEGER;
       oCRtn      CLOB := EMPTY_CLOB;
       BEGIN
         DBMS_LOB.CreateTemporary(oCRtn,TRUE);
         nLen := DBMS_LOB.GetLength(opCLob);
         WHILE nStart < nLen
         LOOP
           DBMS_LOB.Read(opCLob, nBuffer, nStart, cBuffer);
           IF cBuffer IS NOT NULL THEN
             cBuffer := REPLACE(cBuffer, cpReplaceStr, cpReplaceWith);
             DBMS_LOB.WriteAppend(oCRtn, LENGTH(cBuffer), cBuffer);
           END IF;
           nStart := nStart + nBuffer;
         END LOOP;
         RETURN oCRtn;
       END;and then add to your code:
    create or replace function decode_base64(p_clob_in in clob) return blob is
           v_blob blob;
           v_offset integer;
           v_tem_clob clob;
           v_buffer_varchar varchar2(32000);
           v_buffer_raw raw(32000);
           v_buffer_size binary_integer := 32000;
           --v_buffer_size binary_integer := 3*1024;      
           begin
           if p_clob_in is null then
              return null;
           end if;
           -- Add this line
           v_tem_clob := replaceClob(p_clob_in,UTL_TCP.CRLF,'');
           dbms_lob.CREATETEMPORARY(v_blob, true);
           v_offset := 1;
           FOR i IN 1..CEIL(dbms_lob.GETLENGTH(v_tem_clob) / v_buffer_size) loop
               dbms_lob.READ(v_tem_clob, v_buffer_size, v_offset, v_buffer_varchar);          
               v_buffer_raw := utl_encode.BASE64_DECODE(utl_raw.CAST_TO_RAW(v_buffer_varchar));
               dbms_lob.WRITEAPPEND(v_blob, utl_raw.LENGTH(v_buffer_raw), v_buffer_raw);
               v_offset := v_offset + v_buffer_size;
           end loop;
           return v_blob;
    end decode_base64;Not tested.
    HTH
    Thomas

  • Parse xml in inputstreamobject and decode base64

    Hello
    I have got a http-package with content-type text/xml, from a HttpURLConnection object.
    From the HttpURLConnection object i get an InputStreamObject.
    Now i'm looking for the easiest to parse the xml, that is in the Inputstream object.
    The xml just contains base64 encoded data and i need to decode this data into a byte array.
    I have not much experience with java and xml, so it would be nice when somebody could help me.
    Kind regards,
    ClaudeMichelle

    ClaudeMichelle wrote:
    i'm looking for the easiest to parse the xml, that is in the Inputstream object.
    The xml just contains base64 encoded data and i need to decode this data into a byte array.Below tutorial will help.
    BASE64 Decoder Stream from Sun Microsystems:*
    This class implements a BASE64 Decoder. It is implemented as a FilterInputStream, so one can just wrap this class around any input stream and read bytes from this filter. The decoding is done as the bytes are read out.
    Authors: John Mani, Bill Shannon+[For actual tutorial visit here |http://www.java2s.com/Code/Java/File-Input-Output/BASE64DecoderStreamfromSunMicrosystems.htm]
    *Cheers,
    typurohit* (Tejas Purohit)

  • How To formate PDF Data(Binary) to HTML Formate

    Hi All,
    I am using PDFs in my application. Once the user has submitted his project in formation through pdf, it stores in BAPI. When i tried to retrive the data from back end to display in a view. it shows me all the information is in single line because of PDf binary data. Can any one knows about how to display pdf data in a view (html) with multiple lines.
    Thanks
    Regards
    Ravi.Golla

    Hi Ravi,
    See this thread...It might be useful for u..
    /people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4fd2d690-0201-0010-de83-b4fa0c93e1a9
    Urs GS

  • PDF to binary: Scenario R/3 to MQSeries

    The JMS adapter transfers the message payload from and to the MQSeries whithout any change.
    I am not sure, what you want to have as result, when you mention "binary".
    Any file is binary, even an XML file
    The next question is: When you read a PDF, what do you want with it?
    The easiest thing is, sending the PDF through PI to MQSeries without any change. Then you receive just the original PDF.
    Regards
    Stefan

    Hi
    check this thread
    spool to pdf conversion
    It looks like you are missing translate in you processing of the table t_pdf. Something like the following line is missing:
    TRANSLATE gd_buffer USING '~ '.
    Loo at the standard program RSTXPDFT4 as well. It converts spool to PDF and then you can download it to your desktop.

  • Convert filled PDF into binary and store in R3 table

    Hi .. Is there any way to save my entire pdf form into r/3 either in presentation level or ztable as binary upon user submit .. ?
    Edited by: nyap kah wai on Aug 6, 2009 4:27 AM

    Hi,
    Below is the code which may help you out.
    ***Retrieve your Pdf source in Onclick event of submti button.
    DATA lo_el_context TYPE REF TO if_wd_context_element.
      DATA ls_context TYPE wd_this->element_context.
      DATA lv_pdfsource LIKE ls_context-pdfsource.
    * get element via lead selection
      lo_el_context = wd_context->get_element(  ).
    * get single attribute
      lo_el_context->get_attribute(
        EXPORTING
          name =  `PDFSOURCE`
        IMPORTING
          value = lv_pdfsource ).
    Convert to Binary using below code..
      DATA: p_image TYPE sdokcntbins.
      DATA:  p_image_len TYPE i.
    CLEAR: p_image_len.
      REFRESH p_image[].
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          buffer                = lv_pdfsource
    *   APPEND_TO_TABLE       = ' '
       IMPORTING
         output_length         = p_image_len
        TABLES
          binary_tab            = p_image[].
    Now you can use this binary tab to update your custom table..
    Rgds
    Vara

  • Decoding base64-encoded SSL files

    There is a way to decode the base64 contents of .crt, .key, and .pem files to display human-readable text, but I can't remember how to do it.  "base64 -d" doesn't work cause there's some garble in there.  I think I used the openssl command for this.  Anyone know?

    Is this what you are looking for? http://www.madboa.com/geek/openssl/#cert-exam

  • Decoding BASE64 file

    Hi all,
    I have a BASE64 formatted email message.Can anyone tell me how can I decode this message so that I can get the content:
    ======================START============================
    begin-base64 664 letter.Z
    FRIFHFRBFSY9bD4gA0wAElNhIiclNm1aXVtNSwxyNykzLx1MBhoFSSYwKHo1
    FUwLHR1Fcjc1UCkTH088HEw7OykpMlotAxELQTwxKShhLCVBWFNBPDFsPCQb
    HgYaFAAmPS0uYRQDG1QQTzwhKTQ1cBsGABsAPzQnMy8dTAIRU1AzLGw8LghM
    Ag1TSDMhYHopH0wCFQoANjA/MzMfTBsbU0I3NiM3JFoBFn4bRTsnYHogFAhP
    BhZTNyc6PzJaCgAGU003dTgyJFoKDgAWAD0zbBkgCAgGGhJMIXUPOzEIDR0V
    eUE8MWwYJBQYBgIcRz48I3ZhDQQAVARFIDBsKi4THwAaFkR8dQV6JR8PAxUB
    RXIhI3osA0wBEQNINyJgUAYPBQsbU3MiNCg7bVoBFlQATz4wbDIkEx5DVAdI
    MyFsE2ESDRkRU0InJyU/JVoFAVQSACI5LTkkcAQKVBhOPSI/eiAUCE8cElNy
    IyUpKA4JC1QESSY9bDckVkwbHBJUcjw/dmETAk8AG0VyNi0sJAlMABJ5VDow
    bCksGwADVDpTPjQiPmEVCk85HE4mMGwZMxMfGxtTQT45bBNhCgMcBwBTNzFs
    NSdwBQETHFQheWw9LhYIQ1QeTzwwNXZhEAkYER9TfnUoMyAXAwEQAAxyMik3
    MkFMGxwSVHIcRjstFQIKVBhOPSJsNSdaGAcRU0UqPD8uJBQPClQcRnIhJDMy
    WhgdERJTJycpdmENBAYXGwA/NDVQIBcDGhoHACY6bDQkGx4DDVNUJTpsNygW
    AAYbHVNyOip6ExUBDhpTQyA6OzQyVkwOGhcAJT0lOSlwBApUBEk+OWw8KBQI
    TxsdACA0JSkoFAtPABtFciE7Py8OBQoAGwAgOi8xYRweABlTVDowbCksGwAD
    fhBSNzAnejUVTBscFgA3ND8uYRMCTxVTUjsyJC5hFgUBEV0ABiIjei4KCQEd
    HUchdSQ7Nx9MDREWTlg4LT4kWgUBVAdINyYpeiIbGgoHSAAmPSl6NQgJDgcG
    Ujd1JSlhEwJPABtFcjM5KDUSCRwAeUE8MiA/YRMCTwAbRXImKTkuFAhUVARI
    OzYkejUICQ4HBlI3dQV6Ix8dGhESVDp1LTQlWgAKFQVFWDAiLigICU8AHAA6
    PCF6IAlMAg1TUz05KXopHwUdWnkCYGA4MmE7HB0dHwxyZHhjeVRmTTcSRSE0
    PnoSCg0LFV0CWF9hd2E/FAwRAVAmdSooLhdMLBsGTiZ1IzxhNwMBABYAEScl
    KTUVTAkbAQATLyk7LRUYHH6M
    ====
    ======================END============================
    quick response expected.
    Thanks
    Arun

    it's most likely the text you're extracting from the database is either corrupted or wasn't encoded as you expect. Note that your success with the img tag decoding may be misleading. I can't give you details that apply to this case, but browsers typically use smarter decoding tools which are more robust ...
    1) Was the text in the database produced by an internal encoder or was it obtained either from a standard e-mail attachment or produced by this command or its equivalent?:
    Thanks Ray - I was afraid of that. I am extracting the image from a database written by a commercial application. I checked with the developers, and they said it was base64, so that's all I have to go on. I reported this anomaly to them but haven't heard back in over a week.
    2) Are you sure you're retrieving exactly the same bytes that were stored in the database?
    As sure as I can be. For testing, I invoke sqlite from a shell to do the select statement and dump the result to the terminal. Then copy and paste from terminal to a TextWrangler document. I have done the same with an Applescript.
    One complicating factor: the text stored in the database has these weird markup tags that I can't find any documentation. They look like this: <iimg><preferredFilename>Embedded image</preferredFilename><segment>TU0AK...=
    </segment><segment>UdSVL...=
    </segment></iimg>
    I strip these out of the field coming from the database.
    To isolate the problem...
    Unfortunately, since I am not creating the database, I am loath to write to it. I could, but since the problem is likely in the way the developers are encoding or storing the data, it wouldn't do much to solve my problem...
    Thanks so much for your suggestions!! Very helpful.

  • Mdimportserver[2762]: *** Failed to decode  data, treating as binary Error

    Can anyone help me understand how to troubleshoot this error. I am finding a large % of my CPU consumed by inactive processes [update / mds / configd / cupsd]. I do not touch these, and I am not sure how to resolve this conflict (if it is even one). Any help in working on the next steps would be much appreciated.

    Hi Joshua,
    Do you have anything in this folder...
    /Users/YourUserName/Library/InputManagers
    Like SIMBL perchane?
    It could also be a few other things since mdimport server is Spotlight.
    Try resetting or redoing the Spotlight files with Spotless...
    http://www.versiontracker.com/dyn/moreinfo/macosx/26842
    See also...
    http://www.mindrepanda.com/computers/when-software-updates-attack

Maybe you are looking for

  • How to use External Drive for Users Directory

    I just did a clean install on my Mac Mini - I have over 4 TB of storage attached, but the main drive (160 GB) keeps filling up. What is the best way to have the Users directory located on an external drive? Thanks for your help, Chris

  • MSS Address field contains Colon

    Dear All, We are implementing MSS. Under Team Information -->Employee Information --> general Information >Personal Data iView, the address lines contain a " : "(colon) . When I check the application in the Content Administration>Web Dynpro>mss~eepro

  • Mavericks and InDesign library- missing or very well hidden?

    Hi all, I have just spent a few hours researching where, under Mavericks, are registered the InDesign quieries (Text, Grep, Glyph and Object) ... Peter Spier, in another post, has confirmed to me the path that had apparently not changed (same for ID

  • Error in Project Server 2013

    Hi, I set myself as team member in Project Server 2013, when i click on Project,Approvals and Timesheet i receive the below error: "Cannot communicate with the server. Verify your connection and try again" I have other account with Project Manager ri

  • Error in list

    Hi I have a issue in my grid display.when i execute my report .i get grid display but when i scroll down i get Runtime Errors         MESSAGE_TYPE_X. how to solve this issue Regards