Base64 Encoding Problem

I have a String representation of an hexadecimal number such
that :
var s:String = "5300ca"; // 0x53, 0x00, 0xca
I want to cut this string into 3 bytes (0x53, 0x00, 0xca) to
use base64 encoding (3 x 8 bits returns 4 characters with base64
encoding). Here is my code :
import mx.utils.*;
import flash.utils.*;
var byte1:int = parseInt("0x53");
var byte2:int = parseInt("0x00");
var byte3:int = parseInt("0xca");
var b:ByteArray = new ByteArray();
b.writeMultiByte(String.fromCharCode(byte1) +
String.fromCharCode(byte2) + String.fromCharCode(byte3), "utf-16");
var base64Encoder:Base64Encoder = new Base64Encoder();
base64Encoder.encodeBytes(b);
var result:String = base64Encoder.drain(); // result = "Uw=="
The result string is "Uw==" whereas it should be "UwDK"
according to the normalized base64-encoding !
Is it a bug in the base-64 encoding ?

Very important because this limitation is very blocking
according to me. Nobody has an answer ?

Similar Messages

  • Problem with My Base64 Encoding CLOB  Routine.

    I have written a program which reads an xml file into the database
    and makes it Base64encoded.
    This needs to work on 10g and above
    If the read length specified in the code below is greater than the length of the xml_file, then I get the expected result(output).
    However if the read length is less than the length of the file, then I get a lot of '==' in the file and as a result, incorrect encoding which means that the file will not be readable through the application.
    I'm pretty sure I'm reading the blob lengths correctly, and the problem is somehow related to the base64 encoding.Any help appreciated
    [create or replace profile_dir as &profile_dir;
    create global temporary table load_xml
    (profile_text clob)
    on commit delete rows;
    create or replace
    procedure encode_xml_clobs(p_file_in  in varchar2,
                                 p_clob_out out nocopy clob )
    as
    pragma autonomous_transaction;
        dest_clob   CLOB;
        src_clob    BFILE  := BFILENAME('PROFILE_DIR', p_file_in);
        dst_offset  number := 1 ;
        src_offset  number := 1 ;
        lang_ctx    number := DBMS_LOB.DEFAULT_LANG_CTX;
        warning     number;
    -- processing declarations for encoding base64 --
    v_xml_string varchar2(32767);
    v_string varchar2(32767);
    v_start_pos number := 0;
    v_read_length number := 1000;
    v_final_start_pos number;
    v_clob_length number;
    type clob_array_type is table of clob index by binary_integer;
    clob_array clob_array_type;
    v_index number :=0;
    -- Declarations for converting base64encoded string to a clob
    v_encoded_length number;
    v_temp_clob clob;
    BEGIN
        -- THE FOLLOWING BLOCK OF CODE WILL ATTEMPT TO INSERT / WRITE THE CONTENTS
        -- OF AN XML FILE TO A CLOB COLUMN. IN THIS CASE, WE WILL USE THE NEW
        -- DBMS_LOB.LoadCLOBFromFile() API WHICH *DOES* SUPPORT MULTI-BYTE
        -- CHARACTER SET DATA.
    -- load_xml should be a  Global temporary table with on commit delete rows
        INSERT INTO load_xml(profile_text)
            VALUES( empty_clob())
            RETURNING profile_text INTO dest_clob;
        -- OPENING THE SOURCE BFILE IS MANDATORY
        DBMS_LOB.OPEN(src_clob, DBMS_LOB.LOB_READONLY);
        DBMS_LOB.LoadCLOBFromFile(
              DEST_LOB     => dest_clob
            , SRC_BFILE    => src_clob
            , AMOUNT       => DBMS_LOB.GETLENGTH(src_clob)
            , DEST_OFFSET  => dst_offset
            , SRC_OFFSET   => src_offset
            , BFILE_CSID   => DBMS_LOB.DEFAULT_CSID
            , LANG_CONTEXT => lang_ctx
            , WARNING      => warning
        DBMS_LOB.CLOSE(src_clob);
    --    DBMS_OUTPUT.PUT_LINE('Loaded XML File using DBMS_LOB.LoadCLOBFromFile: (ID=1');
    -- file now successfully loaded
    select dbms_lob.GETLENGTH(profile_text)
    into v_clob_length
    from load_xml;
    -- File now loaded in temporary table
    -- we now need to take the clob , convert it to varchar2
    v_read_length :=64;
    v_xml_string := '';
    while v_start_pos <=  v_clob_length
    loop
    v_index := v_index + 1;
    v_string := '';
    --dbms_output.put_line('Start_pos=>'||(v_start_pos+1)||' Read Length=>'||v_read_length);
    --encode base64
    select utl_raw.cast_to_varchar2(
    utl_encode.base64_encode(
    utl_raw.cast_to_raw(dbms_lob.substr(profile_text,least(v_read_length,v_clob_length-v_start_pos),v_start_pos+1))
      into v_string
      from load_xml;
    --dbms_output.put_line(v_string);
    v_start_pos  := v_start_pos+v_read_length;
    clob_array(v_index) := v_string;
    end loop;
    p_clob_out := clob_array(1);
    for i in 2 .. v_index
    loop
    dbms_lob.append(p_clob_out,clob_array(i));
    end loop;
    commit;
    END;

    Base64 encoding encodes every 3 bytes of input data into 4 bytes of output data. It uses equal signs to indicate nodata and only at the end of the encoded sequence. Try chaning your v_read_length parameter to a multiple of 3 e.g. 960 or 1008 instead of the current 1000. I'm using multiples of 48 because the utl_encode.base64_encode function adds a linebreak for every 48 bytes of input data (64 bytes of output). If you use a value that's not divisible by 48 you will still get a legitimate encoding as long as it's divisible by 3, but you will get some lines longer than others when you append them together.

  • Problem with base64 encoding an xml file with accented characters

    Oracle 10.2.0.1.0 Enterprise Edition running under windows 2003 server
    DB Characterset UTF-8
    I have a routine which takes an xml file and base64 encodes it, and the base64encoded text is stored in a clob column of a table.
    The xml file is stored in UTF-8 format.
    The routine works correctly, except when there are accented characters.
    I am using dbms_lob.loadclobfrom file to load the file.
    DBMS_LOB.OPEN(src_clob, DBMS_LOB.LOB_READONLY);
        DBMS_LOB.LoadCLOBFromFile(
              DEST_LOB     => dest_clob
            , SRC_BFILE    => src_clob
            , AMOUNT       => DBMS_LOB.GETLENGTH(src_clob)
            , DEST_OFFSET  => dst_offset
            , SRC_OFFSET   => src_offset
            , BFILE_CSID   =>dbms_lob.default_csid
            , LANG_CONTEXT => lang_ctx
            , WARNING      => warning
        DBMS_LOB.CLOSE(src_clob);base 64 encoded xml with accented character -- incorrect
    PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxncDpBcHBs
    aWNhdGlvblByb2ZpbGUgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAx
    L1hNTFNjaGVtYS1pbnN0YW5jZSINCiAgICB4c2k6c2NoZW1hTG9jYXRpb249Imh0
    dHA6Ly9uYW1lc3BhY2VzLmdsb2JhbHBsYXRmb3JtLm9yZy9zeXN0ZW1zLXByb2Zp
    bGVzLzEuMS4wIGh0dHA6Ly9uYW1lc3BhY2VzLmdsb2JhbHBsYXRmb3JtLm9yZy9z
    eXN0ZW1zLXByb2ZpbGVzLzEuMS4wL0dQLnN5c3RlbXMucHJvZmlsZXMuMS4xLjAu
    QXBwbGljYXRpb25Qcm9maWxlLnhzZCINCiAgICB4bWxuczpncD0iaHR0cDovL25h
    bWVzcGFjZXMuZ2xvYmFscGxhdGZvcm0ub3JnL3N5c3RlbXMtcHJvZmlsZXMvMS4x
    LjAiDQogICAgVW5pcXVlSUQ9Ik1FIiBQcm9maWxlVmVyc2lvbj0iMS4xLjAiIEVy
    cmF0YVZlcnNpb249IjAiPg0KICAgIDxncDpEZXNjcmlwdGlvbj5Gb3J1bSBUZXN0
    PC9ncDpEZXNjcmlwdGlvbj4NCiAgICA8Z3A6RGF0YUVsZW1lbnQgTmFtZT0iw6Fj
    Y2VudCIgRXh0ZXJuYWw9InRydWUiIFR5cGU9IkJ5dGVTdHJpbmciIEVuY29kaW5n
    PSJIRVgiIEZpeGVkTGVuZ3RoPSJmYWxzZSIgTGVuZ3RoPSIxNiIgUmVhZFdyaXRl
    PSJ0cnVlIiBVcGRhdGU9InRydWUiIE9wdGlvbmFsPSJ0cnVlIiAvPiAgICANCjwv
    Z3A6QXBwbGljYXRpb25Qcm9maWxlPg0Kbase 64 encoded xml without accented character -- correct
    PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxncDpBcHBs
    aWNhdGlvblByb2ZpbGUgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAx
    L1hNTFNjaGVtYS1pbnN0YW5jZSINCiAgICB4c2k6c2NoZW1hTG9jYXRpb249Imh0
    dHA6Ly9uYW1lc3BhY2VzLmdsb2JhbHBsYXRmb3JtLm9yZy9zeXN0ZW1zLXByb2Zp
    bGVzLzEuMS4wIGh0dHA6Ly9uYW1lc3BhY2VzLmdsb2JhbHBsYXRmb3JtLm9yZy9z
    eXN0ZW1zLXByb2ZpbGVzLzEuMS4wL0dQLnN5c3RlbXMucHJvZmlsZXMuMS4xLjAu
    QXBwbGljYXRpb25Qcm9maWxlLnhzZCINCiAgICB4bWxuczpncD0iaHR0cDovL25h
    bWVzcGFjZXMuZ2xvYmFscGxhdGZvcm0ub3JnL3N5c3RlbXMtcHJvZmlsZXMvMS4x
    LjAiDQogICAgVW5pcXVlSUQ9Ik1FIiBQcm9maWxlVmVyc2lvbj0iMS4xLjAiIEVy
    cmF0YVZlcnNpb249IjAiPg0KICAgIDxncDpEZXNjcmlwdGlvbj5Gb3J1bSBUZXN0
    PC9ncDpEZXNjcmlwdGlvbj4NCiAgICA8Z3A6RGF0YUVsZW1lbnQgTmFtZT0iYWNj
    ZW50IiBFeHRlcm5hbD0idHJ1ZSIgVHlwZT0iQnl0ZVN0cmluZyIgRW5jb2Rpbmc9
    IkhFWCIgRml4ZWRMZW5ndGg9ImZhbHNlIiBMZW5ndGg9IjE2IiBSZWFkV3JpdGU9
    InRydWUiIFVwZGF0ZT0idHJ1ZSIgT3B0aW9uYWw9InRydWUiIC8+ICAgIA0KPC9n
    cDpBcHBsaWNhdGlvblByb2ZpbGU+DQo=the xml file in use is
    <?xml version="1.0" encoding="UTF-8"?>
    <gp:ApplicationProfile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://namespaces.globalplatform.org/systems-profiles/1.1.0 http://namespaces.globalplatform.org/systems-profiles/1.1.0/GP.systems.profiles.1.1.0.ApplicationProfile.xsd"
        xmlns:gp="http://namespaces.globalplatform.org/systems-profiles/1.1.0"
        UniqueID="ME" ProfileVersion="1.1.0" ErrataVersion="0">
        <gp:Description>Forum Test</gp:Description>
        <gp:DataElement Name="áccent" External="true" Type="ByteString" Encoding="HEX" FixedLength="false" Length="16" ReadWrite="true" Update="true" Optional="true" />   
    </gp:ApplicationProfile>The file is being loaded from a windows xp professional 32 bit system.
    If I just convert the xml text of the file using
    select utl_raw.cast_to_varchar2(
    utl_encode.base64_encode(
    utl_raw.cast_to_raw(
    '<?xml version="1.0" encoding="UTF-8"?>
    <gp:ApplicationProfile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://namespaces.globalplatform.org/systems-profiles/1.1.0 http://namespaces.globalplatform.org/systems-profiles/1.1.0/GP.systems.profiles.1.1.0.ApplicationProfile.xsd"
        xmlns:gp="http://namespaces.globalplatform.org/systems-profiles/1.1.0"
        UniqueID="ME" ProfileVersion="1.1.0" ErrataVersion="0">
        <gp:Description>Forum Test</gp:Description>
        <gp:DataElement Name="áccent" External="true" Type="ByteString" Encoding="HEX" FixedLength="false" Length="16" ReadWrite="true" Update="true" Optional="true" />   
    </gp:applicationprofile>'
    ))) from dual;I get the following
    PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGdwOkFwcGxp
    Y2F0aW9uUHJvZmlsZSB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEv
    WE1MU2NoZW1hLWluc3RhbmNlIgogICAgeHNpOnNjaGVtYUxvY2F0aW9uPSJodHRw
    Oi8vbmFtZXNwYWNlcy5nbG9iYWxwbGF0Zm9ybS5vcmcvc3lzdGVtcy1wcm9maWxl
    cy8xLjEuMCBodHRwOi8vbmFtZXNwYWNlcy5nbG9iYWxwbGF0Zm9ybS5vcmcvc3lz
    dGVtcy1wcm9maWxlcy8xLjEuMC9HUC5zeXN0ZW1zLnByb2ZpbGVzLjEuMS4wLkFw
    cGxpY2F0aW9uUHJvZmlsZS54c2QiCiAgICB4bWxuczpncD0iaHR0cDovL25hbWVz
    cGFjZXMuZ2xvYmFscGxhdGZvcm0ub3JnL3N5c3RlbXMtcHJvZmlsZXMvMS4xLjAi
    CiAgICBVbmlxdWVJRD0iTUUiIFByb2ZpbGVWZXJzaW9uPSIxLjEuMCIgRXJyYXRh
    VmVyc2lvbj0iMCI+CiAgICA8Z3A6RGVzY3JpcHRpb24+Rm9ydW0gVGVzdDwvZ3A6
    RGVzY3JpcHRpb24+CiAgICA8Z3A6RGF0YUVsZW1lbnQgTmFtZT0iw6FjY2VudCIg
    RXh0ZXJuYWw9InRydWUiIFR5cGU9IkJ5dGVTdHJpbmciIEVuY29kaW5nPSJIRVgi
    IEZpeGVkTGVuZ3RoPSJmYWxzZSIgTGVuZ3RoPSIxNiIgUmVhZFdyaXRlPSJ0cnVl
    IiBVcGRhdGU9InRydWUiIE9wdGlvbmFsPSJ0cnVlIiAvPiAgICAKPC9ncDphcHBs
    aWNhdGlvbnByb2ZpbGU+Edited by: Keith Jamieson on Jul 13, 2012 9:59 AM
    added code tag for last base64 encoded object

    Not sure if utl_i18n is already there in version prior to 11.2.0.2.
    But on above mentioned version I can do the simplified method
    SQL> SELECT utl_i18n.raw_to_char (
             utl_encode.base64_encode (
               xmltype (
                 '<?xml version="1.0" encoding="UTF-8"?>
    <gp:ApplicationProfile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://namespaces.globalplatform.org/systems-profiles/1.1.0 http://namespaces.globalplatform.org/systems-profiles/1.1.0/GP.systems.profiles.1.1.0.ApplicationProfile.xsd"
        xmlns:gp="http://namespaces.globalplatform.org/systems-profiles/1.1.0"
        UniqueID="ME" ProfileVersion="1.1.0" ErrataVersion="0">
        <gp:Description>Forum Test</gp:Description>
        <gp:DataElement Name="áccent" External="true" Type="ByteString" Encoding="HEX" FixedLength="false" Length="16" ReadWrite="true" Update="true" Optional="true" />   
    </gp:ApplicationProfile>').getblobval (
                 NLS_CHARSET_ID ('utf8'))),
             'utf8')
             x
      FROM DUAL
    X                                                                                                                                                    
    PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGdwOkFwcGxp                                                                                     
    Y2F0aW9uUHJvZmlsZSB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEv                                                                                     
    WE1MU2NoZW1hLWluc3RhbmNlIiB4c2k6c2NoZW1hTG9jYXRpb249Imh0dHA6Ly9u                                                                                     
    YW1lc3BhY2VzLmdsb2JhbHBsYXRmb3JtLm9yZy9zeXN0ZW1zLXByb2ZpbGVzLzEu                                                                                     
    MS4wIGh0dHA6Ly9uYW1lc3BhY2VzLmdsb2JhbHBsYXRmb3JtLm9yZy9zeXN0ZW1z                                                                                     
    LXByb2ZpbGVzLzEuMS4wL0dQLnN5c3RlbXMucHJvZmlsZXMuMS4xLjAuQXBwbGlj                                                                                     
    YXRpb25Qcm9maWxlLnhzZCIgeG1sbnM6Z3A9Imh0dHA6Ly9uYW1lc3BhY2VzLmds                                                                                     
    b2JhbHBsYXRmb3JtLm9yZy9zeXN0ZW1zLXByb2ZpbGVzLzEuMS4wIiBVbmlxdWVJ                                                                                     
    RD0iTUUiIFByb2ZpbGVWZXJzaW9uPSIxLjEuMCIgRXJyYXRhVmVyc2lvbj0iMCI+                                                                                     
    CiAgPGdwOkRlc2NyaXB0aW9uPkZvcnVtIFRlc3Q8L2dwOkRlc2NyaXB0aW9uPgog                                                                                     
    IDxncDpEYXRhRWxlbWVudCBOYW1lPSLDoWNjZW50IiBFeHRlcm5hbD0idHJ1ZSIg                                                                                     
    VHlwZT0iQnl0ZVN0cmluZyIgRW5jb2Rpbmc9IkhFWCIgRml4ZWRMZW5ndGg9ImZh                                                                                     
    bHNlIiBMZW5ndGg9IjE2IiBSZWFkV3JpdGU9InRydWUiIFVwZGF0ZT0idHJ1ZSIg                                                                                     
    T3B0aW9uYWw9InRydWUiLz4KPC9ncDpBcHBsaWNhdGlvblByb2ZpbGU+Cg==                                                                                         
    1 row selected.which encodes and decodes properly on my system even with accented characters.

  • Data is not Base64 encoded - error when starting Weblogic connecting to IS

    I get the following error trying to connect to Identity Server from weblogic 7.0 via the weblogic java policy agent from Sun:
    java.lang.ExceptionInInitializerError: java.lang.RuntimeException: Data is not Base64 encoded.
    I have set the encode cookie to true on both the policy agent side and the Identity Server side. I have also restarted both, but still receiving this error.
    Has anyone had similar problems? Any soluitions?

    Hello,
    I am getting the same error for a tomcat policy agent . Ihave installed Identity server on Solaris 9 and Tomcat 4.1.27 on the same machine. I set followinf property in policy agent's AMAgent.properties-
    com.iplanet.am.cookie.encode=true
    However, it doesn't help :-(
    what else is to be done? The documentation says that modify AMConfig.properties file on the client side for this property. Howveer, i do not have AMConfig fil on tomcat side. so i modified AMAgent.property.
    Is that ok?

  • Base64 encoded attachments misunderstood by recipients

    My boss uses Mail.app, and a number of people have reported that they can never open her attachments. When I look at the files they receive from her, they appear to be base64 encoded, and indeed decoding them makes them perfectly readable. Unfortunately, I don't think any of the built-in apps in OS X can do this decoding. Also, not all of the recipients use Macs.
    At first I thought that the issue might be that she was not using the 'Windows friendly attachments'. However, I tried sending a message from another coworker's computer without selecting that option, and it worked fine. I then discovered that the problem is that if she drags her attachments into the message rather than selecting them via 'add attachment', they don't work. Basically, if the attachment is inline rather than at the end of the message.
    I still thought that using 'Windows friendly attachments' would fix the problem, so on another Mac I tried setting Mail.app to always send Windows Friendly attachments (To do this, just open Mail.app, make sure you aren't composing an e-mail, and then under Edit > Attachments, select 'Always send Windows Friendly attachments'). However, this didn't work, either.
    So, I think that the solution is just to tell her either to use the 'Add Attachment' button or to drag the file to the end of the message.
    It's a shame that inline attachments don't work for so many e-mail clients (notably Gmail). I don't think that this is an Apple innovation... is it?
    I hope that helps someone,
    Greg

    Did you ever this to work ?

  • Get canvas.toDataURL('image/jpeg') and convert base64 encoding to java.sql.Blob

    Convert canvas.toDataURL('image/jpeg') to java.sql.Blob.
    I am using oracle adf so I am able to action a backing bean from javascript and pass in parameters as a map. I pass in the canvas.toDataURL('image/jpeg') which I then try to decode in my bean. Using BASE64Decoder and the converting the bytearray to a file I can see the image is corrupted as I can't open the file thus converting the bytearray to blob is also a waste.
    Has anyone any ideas on base64 encoding from canvas.toDataURL to file or Blob?

    Use Case:
    A jsf page that enables a user to take photos using the HTML5 canvas feature - interact with webcam -, take photos and upload to profile
    1. I have created the jsf page with the javascript below; this pops up as a dialog and works okay and onclick an upload image, triggers the snapImage javascript function below and sends the imgURL parameter to the serverside managedbean
    <!-- java script-->
    function snapImage(event){
                    var canvas = AdfPage.PAGE.findComponent('canvas');
                    AdfCustomEvent.queue(event.getSource(),"getCamImage",{imgURL:canvas.toDataURL('image/jpeg'),true);
                    event.cancel();
    <!-- bean -->
    public void getCamImage(ClientEvent ce){
    String url=(String)ce.getAttributes().get("imgURL");
    decodeBase64URLToBlob(url);
    private BlobDomain decodeBaseB4URLToBlob(String url64){
                    BASE64Decoder de=new BASE64Decoder();
                    byte[] bytes=de.decode(url64);
                    File file=new File("abc.jpg");
                    InputStream in = new ByteArrayInputStream(bytes);
                    BufferedImage bImageFromConvert = ImageIO.read(in);
                    in.close();
                    ImageIO.write(bImageFromConvert, "jpg", file);
                    return createBlobDomainFromFile(file);
    ----problem---
    Accessing the generated jpeg file shows the image is corrupted, probably missing bytes or encode/decoder issues.and the blob image after uploading to database is saved as a binary stream which ondownload doesnt render as an image or anything i know of.
    Is there anyways of achieving the conversion without errors?

  • Error while reconciling - Data is not Base64 encoded

    I was trying do a Full reconciliation and it failed with following error.
    Reconciliation was terminated because the number of errors exceeded the configured threshold.
    The following errors were received during reconciliation:
    Error while reconciling accountId uid=1testRecordReviewOnl,ou=people,ou=AppUser,dc=educ,dc=mde on resource MIDMS Edp LDAP:
    java.lang.RuntimeException: Data is not Base64 encoded.
    I removed the password attribute from the reconciliation policy and reconciliation ran till the end without any error . What I need to do to fix this.
    Thanks!
    Kabi
    Edited by: kpp on May 5, 2009 7:25 PM

    I am using IDM 8.0.0.0 which dows not allow to load "malformd passwords" into the repository at all. This hit might help you to understand IDM but most likely will not directly solve you problem.
    As mentioned before: Debug page: http://<server>/idm/debug
    Locate the "List Objects" row, select "Resources", push the "List Objects" button.
    Select your resource; Click View; search for "credentials"
    The encrypted credential (aka password) has to be syntactically correct.
    e.g.
    <ResourceAttribute name='credentials' displayName='com.waveset.adapter.RAMessages:RESATTR_PASSWORD' type='encrypted' description='RESATTR_HELP_219' value='0D84E1E9E897E0A5:1C6C4889:11C74E0F02B:-7FF1|hjp/S8m0uNe5Rxs4CGU7uw=='>
    </ResourceAttribute>
    The vertical bar sign "|" splits the credentials in two parts
    1. Server encryption key
    2. Base64 encoded password
    If the later is not Base64 encoded, you will get the error described.
    Again, I doubt that this is or solves your problem but it might help to understand.
    btw. what exactely do you mean with "I removed the password attribute from the reconciliation policy "

  • Base64 encode

    Hi,
    We have to provide a conversion of blobs to base64 in order to exchange data with
    a 3th party. I wrote the following function which is used to format an xml-message.
    Problem is the supplier reads this data with a .net decode of base64 complains it's invalid and it
    sees some lines with more than 76 characters which seems to be not correct.
    Any ideas what is wrong are greatly appreciated.
    9.2.0.4 HPUX11.11
    Tnx,
    Jeroen
    Function getbase64String( lv_blob blob )
    Return clob is
    Result clob;
    resultString VARCHAR2(4096);
    resultString1 clob;
    l_amt number default 2048;
    l_raw raw(4096);
    l_offset number default 1;
    l_clob clob;
    BEGIN
    dbms_output.put_line('length blob: ' || dbms_lob.getlength( lv_blob ) );
    begin
    DBMS_LOB.CREATETEMPORARY(resultString1,FALSE,DBMS_LOB.CALL);
    DBMS_LOB.CREATETEMPORARY(result,FALSE,DBMS_LOB.CALL);
    loop
    dbms_lob.read( lv_blob, l_amt, l_offset, l_raw );
    l_offset := l_offset + l_amt;
    -- dbms_output.put_line(' voor resultstring');
    resultString := utl_raw.cast_to_varchar2( utl_encode.base64_encode( l_raw ) );
    -- dbms_output.put_line(' na resultsstring');
    resultString1:=to_clob(resultString);
    dbms_lob.append(result,resultString1);
    end loop;
    exception
    when no_data_found then
    null;
    end;
    -- dbms_output.put_line('length:'||dbms_lob.getlength(result));
    RETURN ( result );
    END getbase64String;

    Yep, thats what I told you.
    I have modified your code slightly.
    This definitely produces your output.
    Note that you were not using an oracle_directory for p_dir.
    You should have said create or replace directory p_dir as 'your_location';
    Instead you had p_dir varchar2(200) := 'your location';
    The problem with the use of utl_file.put is you have to output a byte at a time. You were trying to output an entire clob, which is why it fell over.
    Note: I also removed your exception handler as this just masks where the error is.
    DECLARE
    p_file varchar2(100):= 'test_img.png';
    p_clob CLOB;
    l_bfile BFILE;
    l_step PLS_INTEGER := 19200;
    dest_file varchar2(100):='test_image.html';
    dest_handle UTL_FILE.file_type;
    v_start number := 1;
    BEGIN
    dbms_output.put_line('Encoding starts');
    l_bfile := BFILENAME('BFILE_DIR', p_file);
    dbms_output.put_line('File is going to open');
    DBMS_LOB.fileopen(l_bfile, DBMS_LOB.file_readonly);
    dest_handle := UTL_FILE.fopen('BFILE_DIR', dest_file, 'w', 32767);
    FOR i IN 0 .. TRUNC((DBMS_LOB.getlength(l_bfile) - 1 )/l_step) LOOP
    dbms_output.put_line('Inside encodeing :'||i);
    p_clob := p_clob||UTL_RAW.cast_to_varchar2(UTL_ENCODE.base64_encode(DBMS_LOB.substr(l_bfile, l_step, i * l_step + 1)));
    END LOOP;
    dbms_output.put_line('Base64 encoded');
    p_clob:= '<img src="data:image/png;base64,'||p_clob||'" width="32" height="32">';
    dbms_output.put_line('Assignment completed');
    for i in 1 .. dbms_lob.getlength(p_clob)
    loop
    UTL_FILE.put(dest_handle, dbms_lob.substr(p_clob,1,v_start));
    v_start := v_start+1;
    end loop;
    DBMS_LOB.fileclose(l_bfile);
    UTL_FILE.fclose(dest_handle);
    end;
    /

  • File saveAsOpen and Base64 encoding...

    In order to send the activeDocument to a web service, i need to save is as a file image, and send in an xml format.
    Thus, i also need to encode it in Base64.
    At this point everything is OK.
    But between the saveAs of the file, its reopening, and its encoding, its corrupted.
    I receive an error on the Mongrel server.
    The Base64 encoder seems to work well, the rest of the code seem to be also ok, so I think my problem is either I do not save it correctly, either i do not reopen it correctly...
    Please save me :(
    Here is the code :
              /* STEP 1 : save current document as image file (temporary) */
              var docRef = activeDocument;
              var filepath=app.path.toString()+"/"+docRef.name+".jpg";//create the image file in the installation folder of Photoshop
              var file = new File(filepath);
              //var options = new ExportOptionsSaveForWeb();
              //options.format = SaveDocumentType.PNG;
              var options = new JPEGSaveOptions();
              options.quality=8;
              docRef.saveAs (file, options, true, Extension.LOWERCASE);
              //docRef.exportDocument (file, ExportType.SAVEFORWEB , options);
              file.close();
    /* I code here dialogBox and httpCOnenction object creation
    that do not need to be written here
    (but if you think it's important, i can give you the full script)
              var f= new File(filepath);
              f.open();
              var buffer = f.read(f.length);
              f.close();
    I build an HttpConnection object called "send"
    */                 send.request='"+f.name+""+f.length+""+base64encode(buffer)+"';
    Here is the Server error :
    Exception working with image: Not a JPEG file: starts with 0xc7 0xff `/var/folders/Nz/NzlixjchF+WAvFkZK9vVRU+++TM/-Tmp-/test599-0.jpg'

    Let's give you everything in fact, it will be more simple (by the way the code is suppose to become OpenSource)<br /><br />I work on Mac, Photoshop CS3 (10.0.1)<br />I use JavaScript<br />HTTP request received by a Mongrel server (Ruby on Rails)<br /><br />// Copyright 2008. Studio Melipone. All rights reserved. <br />// Licence GNU LGPL<br />// Send the active document to the UpShot web service (http://upshotit.com)<br />//  The document is sent as a .png file, as a draft on the user's account.<br />// Therefore you must have a document opened and Adobe Bridge installed to perform this script.<br /><br />/*<br />     <javascriptresource><br />          <name>UpShot</name><br />          <type>automate</type><br />          <about><br />          Script for Upshot <br />          Copyright 2008 Studio Melipone <br />          http://upshotit.com <br />          </about><br />          <enableinfo>true</enableinfo><br />     </javascriptresource>     <br />*/<br /><br />#target photoshop<br />#include "Base64.jsx"<br /><br />app.bringToFront();<br /><br />if( documents.length==0)// is a document opened ?<br />     alert("There are no Photoshop documents opened !")<br />else {<br />          /*********************************************/<br />          /* STEP 1 : save current document as image file (temporary) */<br />          /******************************************/<br />          var docRef = activeDocument;<br />          var filepath=app.path.toString()+"/"+docRef.name+".jpg";//create the image file in the installation folder of Photoshop<br />          var file = new File(filepath);<br />          //var options = new ExportOptionsSaveForWeb();<br />          //options.format = SaveDocumentType.PNG;<br />          var options = new JPEGSaveOptions();<br />          options.quality=8;<br />          docRef.saveAs (file, options, true, Extension.LOWERCASE);<br />          //docRef.exportDocument (file, ExportType.SAVEFORWEB , options);<br />          file.close();<br />          <br />          /********************************************************/<br />          <br />     // Only Bridge can use HttpConnection, so we test if it is installed<br />     var bridgeTarget = BridgeTalk.getSpecifier(getAppSpecifier("bridge")); <br />                    <br />     if( !bridgeTarget ) { <br />          alert("Adobe Bridge not installed, needed to continue."); <br />     } <br />     else {     <br />          preferences.rulerUnits = Units.PIXELS;<br />          displayDialogs = DialogModes.NO;<br />          <br />          /**********************************/<br />          /* STEP 2 : retrieve user's login & password */<br />          /*******************************/<br />          <br />          res = "dialog { text: 'UpShot authentication', \<br />                         info: Panel { orientation: 'column', alignChildren:'right', \<br />                                             text: 'Please Identify Yourself', \<br />                                             login: Group { orientation: 'row', \<br />                                                  s: StaticText { text:'Login :' }, \<br />                                                  e: EditText { characters: 30 } \<br />                                             }, \<br />                                             passwd: Group { orientation: 'row',  \<br />                                                  s: StaticText { text:'Password :' }, \<br />                                                  e: EditText { characters: 30, properties:{noecho: true} }, \<br />                                             } \<br />                                   }, \<br />                         buttons: Group { orientation: 'row', \<br />                                        okBtn: Button { text:'OK', properties:{name:'ok'} }, \<br />                                        cancelBtn: Button { text:'Cancel', properties:{name:'cancel'} } \<br />                         } \<br />                    }"; <br />          <br />          dlg = new Window (res); <br />          dlg.center(); <br />          dlg.show(); <br /><br />          var login = dlg.info.login.e.text;//retrieve the values given in the form<br />          var pass = dlg.info.passwd.e.text;<br /><br />          /******************************/<br />          /* STEP 3 : send image through Bridge */<br />          /***************************/<br />          var f= new File(filepath);<br />          f.open();<br />          var buffer = f.read(f.length);<br />          f.close();<br />          <br />          alert("file size "+file.length);<br />          alert("f size "+f.length);<br />          alert("BUF "+buffer);<br />          alert(base64encode("B64 "+base64encode(buffer)));<br />          <br />          // create a new BridgeTalk message object <br />          var bt = new BridgeTalk; <br />          // target the Adobe Bridge application <br />          bt.target  = bridgeTarget; <br />          //p173 of Javascript Tools Guide for CS3 for http message<br />          bt.body = "\<br />               if(!ExternalObject.webaccesslib ) {\<br />                    ExternalObject.webaccesslib = new ExternalObject('lib:webaccesslib');\<br />               }\<br />               var http = new HttpConnection('http://127.0.0.1:3000/en/users/get_id.xml') ; \<br />               var idfile = new File('"+app.path.toString()+"/id.xml') ;\<br />               http.response = idfile ; \<br />               http.username = '"+login+"';\<br />               http.password = '"+pass+"';\<br />               http.mime='text/xml';\<br />               http.responseencoding='utf8';\<br />               http.execute();\<br />               http.response.close();\<br />               http.close();\<br />               idfile.open();\<br />               var send = new HttpConnection('http://127.0.0.1:3000/en/users/'+idfile.read()+'/upshots') ; \<br />               send.method = 'POST';\<br />               send.username = '"+login+"';\<br />               send.password = '"+pass+"';\<br />               send.mime='text/xml';\<br />               send.requestheaders=['Host','http://localhost:3000'];\<br />               send.requestheaders=['Accept','*/*'];\<br />               send.requestheaders=['Content-Type','text/xml'];\<br />               send.request='<upshot><title>titleforyourimage</title><file_name>"+f.nam e+"</file_name><size>"+f.length+"</size><javafile>"+base64encode(buffer)+"</javafile></ups hot>';\<br />               send.execute();\<br />               idfile.toSource();\<br />          ";<br />          <br />          bt.onResult = function(result) { <br />               object = bt.result = eval(result.body);<br />               //file.remove();<br />               //object.remove();<br />               //bridge.quit ();<br />               return eval(result.body); <br />          } ;<br />          <br />          bt.onError = function( message ) { <br />               var errCode = parseInt (message.headers ["Error-Code"]); <br />               throw new Error (errCode, message.body); <br />          } ;<br />                    <br />          //send the message ( also launch the targetted application)<br />          bt.send(10);<br />     <br />     /**********************************************/<br />     /* STEP 4: Once all done, delete the image previously created */<br />     /*******************************************/<br />     }<br />}<br /><br />//////////////////////////////////////////////////////////////////<br />/////////////////////////////////////////////////////////////////<br />/*functions from http://www.ps-scripts.com/bb/viewtopic.php?t=1282 */<br />//////////////////////////////////////////////////////////////<br />/////////////////////////////////////////////////////////////<br /><br />function getAppSpecifier(appName) {<br /><br />   if (isCS2()) {<br />      if (appName == 'photoshop') {<br />         return 'photoshop-9.0';<br />      }<br />      if (appName == 'bridge') {<br />         return 'bridge-1.0';<br />      }<br />      // add other apps here<br />   }<br /><br />   if (isCS3()) {<br />      if (appName == 'photoshop') {<br />         return 'photoshop-10.0';<br />      }<br />      if (appName == 'bridge') {<br />         return 'bridge-2.0';<br />      }<br />      // add other apps here<br />   }<br /><br />   return undefined;<br />};<br /><br />function isCS2() {<br />   var appName = BridgeTalk.appName;<br />   var version = BridgeTalk.appVersion;<br /><br />   if (appName == 'photoshop') {<br />      return version.match(/^9\./) != null;<br />   }<br />   if (appName == 'bridge') {<br />      return version.match(/^1\./) != null;<br />   }<br /><br />   return false;<br />};<br />function isCS3() {<br />   var appName = BridgeTalk.appName;<br />   var version = BridgeTalk.appVersion;<br /><br />   if (appName == 'photoshop') {<br />      return version.match(/^10\./) != null;<br />   }<br />   if (appName == 'bridge') {<br />      return version.match(/^2\./) != null;<br />   }<br /><br />   return false;<br />};

  • Converting Base64 encoded String to String object

    Hi,
    Description:
    I have a Base64 encoded string and I am using this API for it,
    [ http://ws.apache.org/axis/java/apiDocs/org/apache/axis/encoding/Base64.html]
    I am simply trying to convert it to a String object.
    Problem:
    When I try and write the String, ( which is xml ) as a XMLType to a oracle 9i database I am getting a "Cannot map Unicode to Oracle character." The root problem is because of the conversion of the base64 encoded string to a String object. I noticed that some weird square characters show up at the start of the string after i convert it. It seems like I am not properly converting to a String object. If i change the value of the variable on the fly and delete these little characters at the start, I don't get the uni code error. Just looking for a second thought on this.
    Code: Converting Base64 Encoded String to String object
    public String decodeToString( String base64String )
        byte[] decodedByteArray = Base64.decode( base64String );
        String decodedString = new String( decodedByteArray, "UTF-8");
    }Any suggestions?

    To answer bigdaddy's question and clairfy a bit more:
    Constraints:
    1. Using a integrated 3rd party software that expects a Base64 encoded String and sends back a encoded base64 String.
    2. Using JSF
    3. Oracle 10g database and storing in a XMLType column.
    Steps in process.
    1. I submit my base64 encoded String to this 3rd party software.
    2. The tool takes the encoded string and renders a output that works correctly. The XML can be modified dynamically using this tool.
    3. I have a button that is binded to my jsf backing bean. When that button is clicked, the 3rd party tool sets a backing bean string value with the Base64 String representing the updated XML.
    4. On the backend in my jsf backing bean, i attempt to decode it to string value to store in the oracle database as a XML type. Upon converting the byte[] array to a String, i get this conversion issue.
    Possibly what is happen is that the tool is sending me a different encoding that is not UTF-8. I thought maybe there was a better way of doing the decoding that i wasn't looking at. I will proceed down that path and look at the possibility that the tool is sending back a different encoding then what it should. I was just looking for input on doing the byte[] decoding.
    Thanks for the input though.
    Edited by: haju on Apr 9, 2009 8:41 AM

  • How to disable Base64 encoding

    Hi,
    I'm new to weblogic and my task is to develop a custom identity asserter, I used a SimpleSampleIdentityAsserter example that was available on BEA web some time ago.
    I was progressing very slowly and now it seems I got stuck.
    our proxy adds a header to HTTP request that contains the username in plaintext format (I know, it's not safe at all, but that is not my problem now)
    I think that in this case I have to disable Base64 encoding in "Home >myrealm >Summary of Security Realms >myrealm >Providers >IdentityAsserter"
    "Settings for SSIA2 > Configuration- Tab > Common tab"
    by default the value is set to true : "Base64 Decoding Required:     true"
    I'm unable to change it niether via admin console nor have I found it in any xml config file, does anyone know where and how this can be configured?
    we use WebLogic 10.3
    any help would be much appretiated
    thx, Vaclav

    Hi Sandeep,
    Thanks a lot for your reply.
    I addded those lines in config.xml file as said by you and restarted the weblogic server.
    But still i couldn't set Base64 decoding as false.
    Could you please check this config.xml file where i added these lines.
    <?xml version="1.0" encoding="UTF-8"?>
    <domain xsi:schemaLocation="http://www.bea.com/ns/weblogic/920/domain
    http://www.bea.com/ns/weblogic/920/domain.xsd" xmlns="http://www.bea.com/ns/weblogic/920/domain" xmlns:sec="http://www.bea.com/ns/weblogic/90/security" xmlns:wls="http://www.bea.com/ns/weblogic/90/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <name>base_domain</name>
    <domain-version>9.2.3.0</domain-version>
    <security-configuration xmlns:xacml="http://www.bea.com/ns/weblogic/90/security/xacml">
    <name>base_domain</name>
    <realm>
    <sec:authentication-provider xsi:type="wls:default-authenticatorType"/>
    <sec:authentication-provider xsi:type="wls:default-identity-asserterType">
    <sec:active-type>AuthenticatedUser</sec:active-type>
    <sec:active-type>wsse:PasswordDigest</sec:active-type>
    <sec:active-type>X.509</sec:active-type>
    <sec:base64-decoding-required>false</sec:base64-decoding-required>
    <wls:use-default-user-name-mapper>true</wls:use-default-user-name-mapper>
    <wls:default-user-name-mapper-attribute-type>CN</default-user-name-mapper-attribute-type>
    </sec:authentication-provider>
    <sec:role-mapper xsi:type="xacml:xacml-role-mapperType"/>
    <sec:authorizer xsi:type="xacml:xacml-authorizerType"/>
    <sec:adjudicator xsi:type="wls:default-adjudicatorType"/>
    <sec:credential-mapper xsi:type="wls:default-credential-mapperType"/>
    <sec:cert-path-provider xsi:type="wls:web-logic-cert-path-providerType"/>
    <sec:cert-path-builder>WebLogicCertPathProvider</sec:cert-path-builder>
    <sec:name>myrealm</sec:name>
    </realm>
    <default-realm>myrealm</default-realm>
    <credential-encrypted>{3DES}Vi5yoJAzEZYw/U5nkiNT9B8M043431Rfr/QF2dMB65KlW2rbV3d7a0uGF9YxUnfFZwBv0q0BNLhzmIi/wjJ/sGUnWQ2SvNMK</credential-encrypted>
    <node-manager-username>weblogic</node-manager-username>
    <node-manager-password-encrypted>{3DES}RCc8ftzF/irGNnXbhZ3nRA==</node-manager-password-encrypted>
    </security-configuration>
    <server>
    <name>AdminServer</name>
    <listen-address/>
    </server>
    <embedded-ldap>
    <name>base_domain</name>
    <credential-encrypted>{3DES}tYhX7HO2bVJh5Pn4ldTY45UYYd2zBw/URUs++SXMZ8U=</credential-encrypted>
    </embedded-ldap>
    <configuration-version>9.2.3.0</configuration-version>
    <admin-server-name>AdminServer</admin-server-name>
    </domain>
    Thanks & Regards,
    Swathi

  • Replace value in CLOB containing 2400-3000 bytes of Base64 encoded text

    Hi,
    I need to replace a part of a base64 encoded string stored in a CLOB.
    Basically what I need to do is to:
    - Get data from CLOB
    - Base64 decode
    - Replace a part of the string
    - Base64 encode
    - Put data back into CLOB
    I have tried using the UTL_ENCODE.BASE64_ENCODE (and DECODE). These functions uses and supplies RAW-values, so to convert to RAW I did UTL_RAW.CAST_TO_RAW (and _VARCHAR2 to go back).
    I've found that the RAW-type is limited to 2000 bytes (http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/03_types.htm#10764), but the messages I'm trying to modify is from about 2400 to about 3000 bytes.
    Is there any way around this problem?
    Thanks in advance,
    Jan

    The link you provided states, pl sql variable can be up to 32767 bytes , only database column can be up to 2000 bytes. For processing you describe, i suggest, you are interested only in plsql raw variables, not in the database columns ( which are clob's).
    Best regards
    Maxim

  • Need help loading base64 encoded image.

    I've got an applet that saves an image into a database by posting a base64 encoded version of the image to an ASP page. Basically, I convert the image to an array of bytes, then encode it and post it to the page. Now, my problem occurs after I read the base64 string from the database and try to display it. When the application is started up, it is supposed to read the image and load it into the canvas of the applet, but I get a NullPointerException when I call displayImage because the fgImage has -1 width and height. If anyone has done this before and has any hints or tips, that would be great. Otherwise, take a look at my code and see if you can find something wrong. Thanks!
    public void loadBase64Image(int[] newPixels) {
    System.out.println("loading new image...");
    try {
    if (newPixels == null) {
    byte[] imgPixels = new byte[this.getWidth() * this.getHeight() * 4];
    URL loadURL = new URL(fgImgURL);
    URLConnection imageCon = loadURL.openConnection();
    imageCon.setDoOutput( true );
    imageCon.setUseCaches(false);
    DataInputStream imageIn = new DataInputStream( imageCon.getInputStream() );
    BASE64Decoder decodedImage = new BASE64Decoder();
    imgPixels = decodedImage.decodeBuffer(imageIn);
    imageIn.close();
    int w = this.getWidth();
    int h = this.getHeight();
    int imgPix[] = new int[w * h];
    int index = 0;
    for(int y=0; y<imgPix.length;y++){
    imgPix[y] = imgPixels[4*y]
    | (imgPixels[4*y + 1] >> 8)
    | (imgPixels[4*y + 2] >> 16)
    | (imgPixels[4*y + 3] >> 24);
    imgMemSrc = new MemoryImageSource(w, h, imgPix, 0, w);
    else
    imgMemSrc = new MemoryImageSource(this.getWidth(),this.getHeight(),newPixels,0,this.getWidth());
    // Update the fgImage to the current OSC.
    if (fgImage != null) fgImage.flush();
    fgImage = Toolkit.getDefaultToolkit().createImage(imgMemSrc);
    displayImage(fgImage, this.getWidth(), this.getHeight());
    catch (Exception e){
    System.out.println("BASE64 LOAD ERROR (" + e.getClass() + ": " + e.getMessage() + ")");

    Docs for URLConnection
    "A URL connection can be used for input and/or output. Set the DoInput flag to true if you intend to use the URL connection for input, false if not. The default is true unless DoOutput is explicitly set to true, in which case DoInput defaults to false."
    You have setDoOutput(true), so doInput is by default set to false according to the docs. I would make the change to also setDoInput(true) as well and see if it works.
    public void loadBase64Image(int[] newPixels) {
       System.out.println("loading new image...");
       try {
          if (newPixels == null) {
             byte[] imgPixels = new byte[this.getWidth() * this.getHeight() * 4];
             URL loadURL = new URL(fgImgURL);
             URLConnection imageCon = loadURL.openConnection();
             imageCon.setDoOutput( true );
             imageCon.setDoInput( true ); // Make sure you add this line
             imageCon.setUseCaches(false);
             DataInputStream imageIn = new DataInputStream( imageCon.getInputStream() );
             BASE64Decoder decodedImage = new BASE64Decoder();
             imgPixels = decodedImage.decodeBuffer(imageIn);
             imageIn.close();
             int w = this.getWidth();
             int h = this.getHeight();
             int imgPix[] = new int[w * h];
             int index = 0;
             for(int y=0; y<imgPix.length;y++){
                imgPix[y] = imgPixels[4*y] | (imgPixels[4*y + 1] >> 8) | (imgPixels[4*y + 2] >> 16) | (imgPixels[4*y + 3] >> 24);
             imgMemSrc = new MemoryImageSource(w, h, imgPix, 0, w);
          else
             imgMemSrc = new MemoryImageSource(this.getWidth(),this.getHeight(),newPixels,0,this.getWidth());
          // Update the fgImage to the current OSC.
          if (fgImage != null)
             fgImage.flush();
          fgImage = Toolkit.getDefaultToolkit().createImage(imgMemSrc);
          displayImage(fgImage, this.getWidth(), this.getHeight());
       catch (Exception e){
          System.out.println("BASE64 LOAD ERROR (" + e.getClass() + ": " + e.getMessage() + ")");

  • Improper decoding of base64 encoded attachment on Exchange 2007 SP1

    I'm using Exchange 2007 SP1. My java application sends email to users of exchange 2007 SP1. The email contains an email as an attachment which is base64 encoded . This email when sent to users on exchange 2007 SP1 shows blank attachment. The same email when sent to users on different exchange (e.g. Exchange 2003) shows the correct attachment i.e. the attachments are not blank. While sending the mail i'm setting name of the attachment in Content-Type header but it is not there when we look at the rfc contents of the mail received on ex 2007 SP1.  It seems exchange 2007 is not able to decode the base 64 contents properly. Below are the rfc contents of the mail which show few headers in the attachment part instead of the base64 content. Please suggest some solution to it. It's urgent.
    Received: from test80.psjpr.com (192.168.0.243) by exchange01.psjpr.com
     (192.168.0.138) with Microsoft SMTP Server id 8.1.263.0; Fri, 11 Apr 2008
     18:53:12 +0530
    From: Admin <[email protected]>
    To: test test1 <[email protected]>
    Date: Fri, 11 Apr 2008 18:53:12 +0530
    Subject: Retrieved from : testingggggg
    Thread-Topic: Retrieved from : testingggggg
    Thread-Index: Acib1zFeboxSL6S4RuaeI0AaCou0pQ==
    Message-ID: <[email protected]>
    Accept-Language: en-US
    Content-Language: en-US
    X-MS-Exchange-Organization-AuthAs: Anonymous
    X-MS-Exchange-Organization-AuthSource: exchange01.psjpr.com
    X-MS-Has-Attach: yes
    X-MS-TNEF-Correlator:
    Content-Type: multipart/mixed;
     boundary="_002_9c2e5956bc9b49efbbc61a358f61698bexchange01psjprcom_"
    MIME-Version: 1.0
    --_002_9c2e5956bc9b49efbbc61a358f61698bexchange01psjprcom_
    Content-Type: text/plain; charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    The message you requested is attached.
    --_002_9c2e5956bc9b49efbbc61a358f61698bexchange01psjprcom_
    Content-Type: message/rfc822
    Subject:
    Thread-Index: Acib1zFexS+KMQAOSD+lcMut076Wyg==
    Accept-Language: en-US
    X-MS-Has-Attach:
    X-MS-TNEF-Correlator:
    Content-Type: text/plain; charset="us-ascii"
    Content-Transfer-Encoding: quoted-printable
    MIME-Version: 1.0
    --_002_9c2e5956bc9b49efbbc61a358f61698bexchange01psjprcom_--

    Did you ever this to work ?

  • Encoding problems in email while on Windows Mail app

    Hello.
    I have a question concerning email and encoding problems in the Windows Mail App in Windows 8.1.  I have encountered a problem with an email I received, while reading, I see strange ASCII characters in one email.  I have never encountered it in
    my web browsers nor Gmail, just the Mail App.
    I was referred to come here when I had asked a similar question there:
    http://answers.microsoft.com/en-us/windows/forum/windows8_1-ecoms/strange-foreign-ascii-characters-appearing-in/911f8a44-c302-4fa1-bcaa-3297b32d9120
    I don't know which forum to go to so I picked here.
    Is there any way that it can be resolved.  I tried to troubleshoot, nothing worked; I even synched, to no avail.
    I look forward to a response.
    JB

    Hi JB,
    The responder on answers was a bit confused. The MSDN forums are for developers to discuss writing their own apps. We cannot help with problems using Windows or its built-in apps.
    If the folks on answers cannot help then you may need to open a support incident. See
    http://support.microsoft.com , or the folks on answers may be able to direct you to the specific page for the Windows Mail app.
    --Rob

Maybe you are looking for

  • Aio remote doesn't work on windows 8.1, can't findprinter

    hp aio remote on windows cannot find my printer.  i could tell it its ip #, but software disallows this, apparently assuming that sw is perfect and users are incompetent, where the opposite is usu true.  similarly, hp has no feedback mechanism and wo

  • Oracle Replication - Encrypted Data and Oracle Data Guard

    We are working on a high availability architecture for one of our new projects. The preliminary architecture has Oracle 10g Release 2(10.2.0.2) production database (primary database) running on Solaris10 server for OLTP operations. And a production r

  • M72z - trying to install Wireless-N 2230 :/

    Hi, I'm trying to install Wireless-N 2230 in M72z but when i plug it inn and start the machine I get a communicat:  Error 1802: unauthorised network card plugged in - Power off and remove the network card. Well - I thought that if I buy a card that i

  • HT201272 Downloaded songs wont play

    I have downloaded songs from itunes and they won't play on an authorized computer or ipod.

  • How to create a non-accessible script?

    I have to develop a script member that contains some procedures and functions. Is there a way to produce some "hidden" script? I think the first solution is to put this script in an external cast and protect it (AKA make it CXT). But... Is there a wa