Base64 Encoding of PDF file existing in file system

Hello,
I need your help in finding the best way to read a file in PDF format that is in the file system of the oracle application server from the oracle database server.
From a stored procedure in database, I need to read the PDF file and get its data to binary 64 text.
I need to use PL/SQL, what are your recomendations, any sample?
Thanks.

Did you try google?
http://www.google.com/#sclient=psy&hl=en&source=hp&q=oracle+read+pdf+file&aq=0v&aqi=g-v1&aql=&oq=&pbx=1&bav=on.2,or.r_gc.r_pw.&fp=e5b130cc10bf5fa1
G.

Similar Messages

  • File exists/Modified file

    I was hoping someone could point me out in the right direction. I need to first test if the file exists and if it exists then test to see when it was last modified. If the file was modified within a certain time frame then that calls the function.
    if "file" exists
    if "file" was modified within timeframe
    then function

    java.io.File has the methods u are after!

  • Check if file exists in file receiver adapter

    hello,
      we have following scenario -> proxy to file
      before appending to the file, it should be copied/renamed to a "tmp" file
      xi should then append to that tmp file and copy/rename the file back to the normal name
    I tried it with "Run operating system command before message processing" but
    it's not working
    anybody has an example on how to use those settings before/after message processing ?
    regards,
    michel

    Hi Michel,
    little confused,
    1) before message processing do there any file exists?
    2) why should we change file name to 'tmp' and append data to that and again rename that file ?
    con't we directly proceed in append mode with file name?
    When we use single command say for example cp or mv (copy or move) the commands then 
    eg: cp %F /var/opt/data/outbound/Test/Dummy.txt 
    when we club commands together or try to redirect the outputs of commands
    eg: cp %F /var/opt/data/outbound/Test/Dummy.txt & mv %F /var/opt/data/outbound/Test/Dummy.txt
            or
          cp %F /var/opt/data/outbound/Test/Dummy.txt
          mv %F /var/opt/data/outbound/Test/Dummy.txt
    Include all ur command in one file and call that file in the OS parameter
    Regards,
    Pradeep A.

  • Checking file exist using file exist operator

    Hi all,
    My environment is owb 9i. DB is oracle 9.2.0.8
    My business requirement is,
    If file exists in the landing directory the next instant my mapping should start execution other wise it should wait untill the file arrives there.
    How could i achive this functionality???
    For this i am utilizing the file exist operator in process flow.
    When the file exists in the specified directory i am able to execute the process flow quite fine but when the file doesnt exist in the specified directory the file exist operator is in wait state and even after when the file is placed into the directory, still the process flow remains in the wait state.
    please suggest me a way.
    thanks in advance.
    ram.

    Hi Ram,
    The problem you are hitting here is that there is no wait activity and no loop activity (yet) in the process flow editor. So it is hard to model this logically.
    Would it be a good idea to write shell script that does similar things? You could check for a file, pauze and check again. Then error out or succeed...
    In the 10gR2 release of OWB you can completely model this using waits and loops.
    Thanks,
    Jean-Pierre

  • Check file existance in operating system

    Dear Collegues,
    Is there any function in oracle that checks a file existance located on local disk of windows computers?
    Like i have created a file c:\test.txt and i want to check through oracle function that this file exists or not.
    Regards,
    Imran Baig

    Is there any function in oracle that checks a file
    existance located on local disk of windows
    computers?Let's see if I understand the question correctly ...
    - You have two computers.
    - One is a client, the other is a database server.
    - You want to use an Oracle function, therefore you want to issue a request to the database server, asking the server if a file exists on the client.
    Is that correct?
    If it is correct, please tell us how the server mounts, or otherwise looks at, the client's disk? Once we have that answer, we might be able to answer your question ...

  • 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.

  • Since Firefox 4, I can get a background image to work using base64 encoded, but not a local file, this worked in Firefox 3, how do I resolve this.

    Using either of the 4 examples shown below, to have a background image display inside about:blank worked in Firefox 3.x (using Stylish add-on), however since Firefox 4, only using the base64 encoded version of images works. Is there any way to fix this so I don't have to encode every image I wish to use? Encoding the image makes the stylish file absolutely huge, & a real pain to keep encoding whenever I want to change the image.
    body:empty { background: url("resource:/res/images/OnFire.jpg")
    body { background-image: url("resource:/res/images/OnFire.jpg")
    body:empty { background:url("data:
    body { background-image: url("data:
    I've also previously disabled most of the add-ons, except for Status-4-Evar, Stylish, & Firebug, in an attempt to see if something else was interfering, but no change.
    I can supply a copy of the previously working (FF 3.x) code to some of the about:blank styles if needed for testing purposes.

    Type '''about:addons'''<enter> in the address bar to open the '''Add-ons Manager.'''
    Hot key; '''<Control>''(Mac:<Command>)'' <Shift> A)'''
    On the left side of the page, select '''Plugins.'''
    Is it listed here? Select '''Disable.'''

  • 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 />};

  • 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

  • Sending a PDF document as a file attachment

    Hi,
    I have encountered the following problem:
    When attaching a pdf document to an email and sending it via Javamail, the resulting PDF document on the other end (i.e. when opened via an email client, such as Outlook) is corrupted and cannot be opened in Acrobar Reader. When doing a side by side comparison with the original file, the emailed document is 1 byte larger than the original (which can possibly cause the "corrupted file error").
    Now, this is happening in my company's application and is happening to only one of our customers. This does not happen to 99.9% of them nor can we duplicate it. In addition, it does not happen to all PDF documents, only a few of them.
    I have also ensured that our client has the latest version of Javamail and the activation framework jar files.
    One thing I have noticed is that the documents are "encoded" as 7bit. This makes sense since the Javadocs explain that if a file is "US-ASCII only" it will be encoded as 7bit, otherwise it will be encoded as base64. Many of our PDF documents are text only.
    My side question is, is there a way to force it to encode it as base64 for all pdf documents and would this help?
    My main question is: Does anyone know what is happening and what I can do about it?
    Anyway, here is the code fragment that does the attachment:
                          for (int i = 0; i < attachments.length; i++)
                             messageBodyPart = new MimeBodyPart();
                             FileDataSource fileDataSource = new FileDataSource(attachments);
                             messageBodyPart.setDataHandler(new DataHandler(fileDataSource));
                             String fileName = attachments[i].getName();
                             messageBodyPart.setFileName(fileName);
                             multipart.addBodyPart(messageBodyPart);
    Where attachments is a File array.

    Only one of your customers. And they can only handle base-64 encoding and not 7-bit encoding of mail messages.
    We had the same thing. We send thousands of files every week using JavaMail, most of them PDFs and other files that are all text. Just one of our customers had some cruddy mail handler they had written themselves, or something like that, and it only liked base-64 encoded messages. This was fine for them because MS Outlook automatically does that for attachments regardless, and everybody was using Outlook to send them files. Except us. So we had to set up a hokey scheme where we would send their messages to a local MS Exchange address and have them auto-forwarded to the customer's address. (I couldn't find any way to control base-64 versus 7-bit encoding.)
    But that customer wasn't using Outlook to read the messages, so maybe that isn't the problem. We also had a supplier (fortunately an ex-supplier now) who we used to send zip files to (from Outlook even) and their mail server would insert extra line breaks into the attachment, thus making the zip file corrupted. Maybe something like that is happening.
    We had another customer who used Lotus Notes as their mail server, and it couldn't deal with our plain ordinary PDFs either. But I think Notes must have had some bug fixes because I haven't heard about that problem lately.
    Good luck.

  • Encode a PDF into base64 xml

    Hi Pal,
    There is a requirement to generate an Adobe Form using SAP Interactive forms, and then, send this PDF to a non-SAP system using Base-64 encoding. The receiving system will decode this file.
    I have heard that this could be done in the PI layer, using the Conversion Agent.
    Another approach which I can think of is convert PDF to binary and then use the cl_http_utility=>encode_base64 to convert binary to base64. howvere, I am unaware of how to convert PDF to binary.
    Could someone guide me thorugh this please?
    Thanks,
    Preethi.

    To convert a spool into a binary table, take a look here:
    http://wiki.sdn.sap.com/wiki/display/Snippets/Convert%20Smartform%20to%20PDF%20format?bc=true
    I've done a similar scenario, and i've developed the conversion on Abap side, with cl_http_utility=>encode_base64 method into an xstring field.
    In your case, there's the Adobe I Form, than you need to save PDF file in a system's directory, you need to read the generated file, encode, and than send out.
    You can also use Conversion Agent, and do the conversion in PI system.

  • Smartform : PDF to Base64 encoding

    Hi .
    I am new to ABAP & Smartform.I have a requirement to convert smartform PDF to Base 64.I've tried the methods provided in the related SDN threads.But while decoding , junk characters are coming.Please find my code below :
    Convert SF output to PDF format
    *convert the smartform to .pdf file
          DATA : I_DOC TYPE TABLE OF DOCS,
                       WA_DOC TYPE DOCS,
                       L_PDF_STRING TYPE XSTRING.
          I_OTFDATA[] = ST_JOB_OUTPUT_INFO-OTFDATA[].
          CALL FUNCTION 'CONVERT_OTF'
            EXPORTING
              FORMAT                = 'PDF'
              MAX_LINEWIDTH         = 132
            IMPORTING
              BIN_FILESIZE          = V_BIN_FILESIZE
              BIN_FILE              = L_PDF_STRING
            TABLES
              OTF                   = I_OTFDATA
              LINES                 = I_LINES.
    Convert Table i_bin to base64 encoding
      DATA : I_BASE64  TYPE STANDARD TABLE OF SOLISTI1,
             WA_BASE64 TYPE SOLISTI1,
             WA_LINES  TYPE TLINE.
      DATA: LV_OUTPUT(255) TYPE C,
            LV_INPUT(132) TYPE C,
            LV_X(255) TYPE X,
            LV_I TYPE I.
      DATA: CONV TYPE REF TO CL_ABAP_CONV_OUT_CE.
      LOOP AT I_LINES INTO WA_LINES.
        LV_INPUT = WA_LINES-TDLINE.
        LV_I = STRLEN( LV_INPUT ).
       CONDENSE lv_input.
        IF LV_I > 0.
          TRY.
              CALL METHOD CL_ABAP_CONV_OUT_CE=>CREATE
                EXPORTING
                  ENCODING    = 'UTF-8'
                  ENDIAN      = 'L'
                  replacement = '#'
                  ignore_cerr = ABAP_FALSE
                RECEIVING
                  CONV        = CONV .
            CATCH CX_PARAMETER_INVALID_RANGE .
            CATCH CX_SY_CODEPAGE_CONVERTER_INIT .
          ENDTRY.
                  CALL METHOD CONV->WRITE
                EXPORTING
                  N      = LV_I
                  DATA   = LV_INPUT
                view   =
              IMPORTING
                len    =
              LV_X = CONV->GET_BUFFER( ).
          CALL FUNCTION 'HTTP_BASE64_ENCODE'
            EXPORTING
              INPUT        = LV_X
              INPUT_LENGTH = LV_I
            IMPORTING
              OUTPUT       = LV_OUTPUT.
        Append to Table
          WA_BASE64-LINE = LV_OUTPUT.
          APPEND WA_BASE64 TO I_BASE64.
          CLEAR : LV_OUTPUT, LV_X, LV_I, WA_BASE64, WA_LINES.
        ENDIF.
      ENDLOOP.
    Thanks,
    Jayita Ganguly

    Hi,
    Jayita2011 wrote:
    LV_X = WA_PDF-TDLINE.
    As WA_PDF-TDLINE is type C, and LV_X is type X, it does a conversion BUT it is not what you expect: LV_X = 'RMjlùIOJM%8RUZ3T', it will set LV_X = all zeroes as 'RM...' does not start with an hexadecimal string (and so base 64 would return AAAAAA). See the ABAP doc for more info.
    Moreover, base 64 encoding must be done with the whole byte stream (more precisely you must not split it outside chunks of 3 bytes, as this encoding converts 3 bytes into 4 characters, converting 2 bytes makes no sense for example, except at the end of the stream).
    I advise you to use CL_HTTP_UTILITY=>ENCODE_BASE64 which converts a string which is casted as bytes. Before, you must concatenate the lines into a string, either using CONCATENATE LINES OF lt_char INTO l_target RESPECTING BLANKS, or SWA_STRING_FROM_TABLE (keep_trailing_spaces='X') depending on your release. Don't forget to shorten the string at exactly the number of representative characters (LV_I in your example).
    BR
    Sandra

  • Can't Figure Out How to Add Nodes to Existing XML File by Attribute

    <?xml version="1.0" encoding="UTF-8"?>
    -<Project_Data>
    -<Project_Info>
    <Client>frankLINVILE</Client>
    <Name>COOKIE MONSTER INDICTMNET</Name>
    <Number>198883cookie</Number>
    <Tester>JK</Tester>
    <Reviewer>CM</Reviewer>
    <Location>Sesame Street, MD</Location>
    <SD>03/10/2015</SD>
    <Boring_Header>Boring1</Boring_Header>
    <Sample_Header>Sample2</Sample_Header>
    <Depth_Header>Depth3</Depth_Header>
    <Location_Header>Location4</Location_Header>
    <SD_Header>Sample Date5</SD_Header>
    <Remarks>asdf sdafas</Remarks>
    <Is_LOC_Global>True</Is_LOC_Global>
    <Is_SD_Global>True</Is_SD_Global>
    <Count>12</Count>
    <Has_MC_Data>N</Has_MC_Data>
    </Project_Info>
    -<Samples>
    -<Sample ID="@B1 S1 1-2 SESAME STREET, MD 03/10/2015">
    <Boring>b1</Boring>
    <Sample>s1</Sample>
    <Depth>1-2</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>frank1</Remarks>
    <Login_Order>1</Login_Order>
    <Report_Order>1</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@B2 S2 2-2 SESAME STREET, MD 03/10/2015">
    <Boring>b2</Boring>
    <Sample>s2</Sample>
    <Depth>2-2</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>frakn2</Remarks>
    <Login_Order>2</Login_Order>
    <Report_Order>2</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@B3 S3 3-3 SESAME STREET, MD 03/10/2015">
    <Boring>b3</Boring>
    <Sample>s3</Sample>
    <Depth>3-3</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>frakn3</Remarks>
    <Login_Order>3</Login_Order>
    <Report_Order>3</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@B4 S4 4-4 SESAME STREET, MD 03/10/2015">
    <Boring>b4</Boring>
    <Sample>s4</Sample>
    <Depth>4-4</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi4</Remarks>
    <Login_Order>4</Login_Order>
    <Report_Order>4</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@B5 S5 5-5 SESAME STREET, MD 03/10/2015">
    <Boring>b5</Boring>
    <Sample>s5</Sample>
    <Depth>5-5</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi5</Remarks>
    <Login_Order>5</Login_Order>
    <Report_Order>5</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@B6 S6 6-6 SESAME STREET, MD 03/10/2015">
    <Boring>b6</Boring>
    <Sample>s6</Sample>
    <Depth>6-6</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi6</Remarks>
    <Login_Order>6</Login_Order>
    <Report_Order>6</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@B7 S7 7-7 SESAME STREET, MD 03/10/2015">
    <Boring>b7</Boring>
    <Sample>s7</Sample>
    <Depth>7-7</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi7</Remarks>
    <Login_Order>9</Login_Order>
    <Report_Order>9</Report_Order>
    <Has_Data>N</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@B8 S8 8-8 SESAME STREET, MD 03/10/2015">
    <Boring>b8</Boring>
    <Sample>s8</Sample>
    <Depth>8-8</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi8</Remarks>
    <Login_Order>10</Login_Order>
    <Report_Order>10</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@B9 S9 9-9 SESAME STREET, MD 03/10/2015">
    <Boring>b9</Boring>
    <Sample>s9</Sample>
    <Depth>9-9</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi9</Remarks>
    <Login_Order>11</Login_Order>
    <Report_Order>11</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@B10 S10 10-10 SESAME STREET, MD 03/10/2015">
    <Boring>b10</Boring>
    <Sample>s10</Sample>
    <Depth>10-10</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi10</Remarks>
    <Login_Order>12</Login_Order>
    <Report_Order>12</Report_Order>
    <Has_Data>N</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@FRANK FARKN2">
    <Boring>frank</Boring>
    <Sample>farkn2</Sample>
    <Depth> </Depth>
    <Location> </Location>
    <SD> </SD>
    <Remarks> </Remarks>
    <Login_Order>7</Login_Order>
    <Report_Order>7</Report_Order>
    <Has_Data>N</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@FRANK FRANK">
    <Boring>frank</Boring>
    <Sample>frank</Sample>
    <Depth> </Depth>
    <Location> </Location>
    <SD> </SD>
    <Remarks> </Remarks>
    <Login_Order>8</Login_Order>
    <Report_Order>8</Report_Order>
    <Has_Data>N</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    </Samples>
    </Project_Data
    What I need to do is find the sample by its ID attribute...IN THEN add the following
    <MC_Data>
    <Wet>blah</Wet
    <Dry>blah</Dry>
    </MC_Data>
    Here is the code I have now, which doesn't work...
    Public Sub XML_Add_Child_Node_Group(Sample_ID As String, Which_Category As Integer)
            If File.Exists(Program_Settings_File.PG_Filepath) = False Then MsgBox("The program settings file for the program has been moved or deleted! Cancelled.") : Exit Sub
            Dim XMLFile As New Xml.XmlDocument, NewNode As Xml.XmlElement = Nothing, NewChild As Xml.XmlElement = Nothing
            XMLFile.Load(Current_File.Current_File_Path)
            Dim Root_Node As XmlNode = XMLFile.SelectSingleNode("/Project_Data/Samples/[@ID='" & Sample_ID & "']")
            Dim Root_Element As Xml.XmlElement = CType(XMLFile.SelectSingleNode("/Project_Data/Samples/[@ID='" & Sample_ID & "']"), XmlElement)
            '1 = Add MC nodes
            Select Which_Category
                Case 1
                    '----Add new node.
                    NewNode = XMLFile.CreateElement("MC_Data")
                    '----Add children nodes.
                    NewChild = XMLFile.CreateElement("MC_Wet") : NewNode.AppendChild(NewChild)
                    'MsgBox(NewNode.Name)
                    NewChild = XMLFile.CreateElement("MC_Dry") : NewNode.AppendChild(NewChild)
                    NewChild = XMLFile.CreateElement("MC_Tare") : NewNode.AppendChild(NewChild)
                    NewChild = XMLFile.CreateElement("MC_Tare_No") : NewNode.AppendChild(NewChild)
                    NewChild = XMLFile.CreateElement("MC_Remarks") : NewNode.AppendChild(NewChild)
                    NewChild = XMLFile.CreateElement("MC_MC") : NewNode.AppendChild(NewChild)
                    Root_Element.AppendChild(NewNode)
            End Select
            '----Add entire tree.
            XMLFile.Save(Current_File.Current_File_Path)
        End Sub
    No matter what, it will not add these nodes. Can anyone help me out? Thanks ahead of time...
    Shawn

    Here is the XML
    <?xml version="1.0" encoding="UTF-8"?>
    <Project_Data>
    <Project_Info>
    <Client>frankLINVILE</Client>
    <Name>COOKIE MONSTER INDICTMNET</Name>
    <Number>198883cookie</Number>
    <Tester>JK</Tester>
    <Reviewer>CM</Reviewer>
    <Location>Sesame Street, MD</Location>
    <SD>03/10/2015</SD>
    <Boring_Header>Boring1</Boring_Header>
    <Sample_Header>Sample2</Sample_Header>
    <Depth_Header>Depth3</Depth_Header>
    <Location_Header>Location4</Location_Header>
    <SD_Header>Sample Date5</SD_Header>
    <Remarks>asdf sdafas</Remarks>
    <Is_LOC_Global>True</Is_LOC_Global>
    <Is_SD_Global>True</Is_SD_Global>
    <Count>12</Count>
    <Has_MC_Data>N</Has_MC_Data>
    </Project_Info>
    <Samples>
    <Sample ID="@B1 S1 1-2 SESAME STREET, MD 03/10/2015">
    <Boring>b1</Boring>
    <Sample>s1</Sample>
    <Depth>1-2</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>frank1</Remarks>
    <Login_Order>1</Login_Order>
    <Report_Order>1</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@B2 S2 2-2 SESAME STREET, MD 03/10/2015">
    <Boring>b2</Boring>
    <Sample>s2</Sample>
    <Depth>2-2</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>frakn2</Remarks>
    <Login_Order>2</Login_Order>
    <Report_Order>2</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@B3 S3 3-3 SESAME STREET, MD 03/10/2015">
    <Boring>b3</Boring>
    <Sample>s3</Sample>
    <Depth>3-3</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>frakn3</Remarks>
    <Login_Order>3</Login_Order>
    <Report_Order>3</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@B4 S4 4-4 SESAME STREET, MD 03/10/2015">
    <Boring>b4</Boring>
    <Sample>s4</Sample>
    <Depth>4-4</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi4</Remarks>
    <Login_Order>4</Login_Order>
    <Report_Order>4</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@B5 S5 5-5 SESAME STREET, MD 03/10/2015">
    <Boring>b5</Boring>
    <Sample>s5</Sample>
    <Depth>5-5</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi5</Remarks>
    <Login_Order>5</Login_Order>
    <Report_Order>5</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@B6 S6 6-6 SESAME STREET, MD 03/10/2015">
    <Boring>b6</Boring>
    <Sample>s6</Sample>
    <Depth>6-6</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi6</Remarks>
    <Login_Order>6</Login_Order>
    <Report_Order>6</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@B7 S7 7-7 SESAME STREET, MD 03/10/2015">
    <Boring>b7</Boring>
    <Sample>s7</Sample>
    <Depth>7-7</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi7</Remarks>
    <Login_Order>9</Login_Order>
    <Report_Order>9</Report_Order>
    <Has_Data>N</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@B8 S8 8-8 SESAME STREET, MD 03/10/2015">
    <Boring>b8</Boring>
    <Sample>s8</Sample>
    <Depth>8-8</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi8</Remarks>
    <Login_Order>10</Login_Order>
    <Report_Order>10</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@B9 S9 9-9 SESAME STREET, MD 03/10/2015">
    <Boring>b9</Boring>
    <Sample>s9</Sample>
    <Depth>9-9</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi9</Remarks>
    <Login_Order>11</Login_Order>
    <Report_Order>11</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@B10 S10 10-10 SESAME STREET, MD 03/10/2015">
    <Boring>b10</Boring>
    <Sample>s10</Sample>
    <Depth>10-10</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi10</Remarks>
    <Login_Order>12</Login_Order>
    <Report_Order>12</Report_Order>
    <Has_Data>N</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@FRANK FARKN2">
    <Boring>frank</Boring>
    <Sample>farkn2</Sample>
    <Depth> </Depth>
    <Location> </Location>
    <SD> </SD>
    <Remarks> </Remarks>
    <Login_Order>7</Login_Order>
    <Report_Order>7</Report_Order>
    <Has_Data>N</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@FRANK FRANK">
    <Boring>frank</Boring>
    <Sample>frank</Sample>
    <Depth> </Depth>
    <Location> </Location>
    <SD> </SD>
    <Remarks> </Remarks>
    <Login_Order>8</Login_Order>
    <Report_Order>8</Report_Order>
    <Has_Data>N</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    </Samples>
    </Project_Data>
    jdweng

  • File exist/file not exist

    OK, i create a directory i have read/write permissions on the directory, but still even if the file exists its bringing back the result as if it doesnt i need help with this...
    set serveroutput on
    DECLARE
    fexists    BOOLEAN;
    flen  NUMBER;
    bsize NUMBER;
    BEGIN
    sys.utl_file.fgetattr('TMP_LOCATION', 'test.txt', fexists, flen, bsize);
      IF fexists THEN
        dbms_output.put_line('File Exists');
      ELSE
        dbms_output.put_line('File Does Not Exist');
      END IF;
      dbms_output.put_line('File Length: ' || TO_CHAR(flen));
      dbms_output.put_line('Block Size: ' || TO_CHAR(bsize));
    END fgetattr;
    File Does Not Existmy directory.. CREATE or replace DIRECTORY tmp_location AS 'Server-1\configsheets\completed\pdf approved'

    Good afternoon,
    If you are loooking at a mapped drive, you can only see it if you change how the Oracle services start. You need to have them start with a specific user ID rather than starting as system services. The problem is that the system services cannot see mapped drives.
    So, do this:
    <li>Create a user to be used by Oracle services. Make sure they have the correct rights (I gave mine Server ADMIN so as to have all the access I needed)
    <li>Log into the server and modify the services
    <li>Click the 'Log On' tab and enter the account and password you created for the Oracle Processes
    <li>Reboot the server, allowing the Oracle services to log in with this new ID.
    This should then fix your problem.
    Thanks,
    Don.
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone! :)

  • How do I merge 2 pdf files into one file?

    How do I merge 2 pdf files into one file?

    I use PrimoPDF (free download) to create pdf files. To merge two docs/pdfs/etc., print the first to a new pdf using Primo. Close it, then print the second and save it to the same new pdf. Primo gives you the option to 'append' or 'overwrite' the original file. By using 'append', you are just adding it to the back of the existing file. You can do this repeatedly to resort or combine existing pages into a new pdf.
    Also, I'm using Adobe Reader X.

Maybe you are looking for

  • Latest SDK failing to mount? Can anyone help

    Hi, Not sure if this should be in this forum or the developer one. Just bought two lovely new macs for my department at school. One of the key reasons for doing this is to be able to develop apps for iphones and ipads. Unfortunately whenever I try to

  • F-28 problem

    when we post using F-28, Cash Discount is automatically calculated by SAP. but user is able to override the system calculated discount. can SAP block the User Override option? how to achieve it, thanks

  • Simple image rotation

    Hi all, Have a couple of pages on a site i'm building where i need a simple image rotation / image swap. It doesn't have to be anything flash, it's purely for a 200px square image to automatically swap every 5 seconds or so. It doesn't need any user

  • Activation - Error:Cannot store binary and a few other NWDI questions.

    Hi all! I'm working on the Internet Sales Application (crm/b2b) in CRM 6.0. The work i do is an upgrade from CRM 4 to CRM 6, so I'm new to NWDI. I'm following the "ISA50DevExtGuideConcepts21.pdf" (since I haven't found a document for version 6), and

  • Why are shapes so difficult to use now?

    I cant see a single way shapes in CC are better.  All extra stages and annoyances, anyone have better workflow method to combat these new things? 1. Cant duplicate easily. Before: select layer, cmd + j = duplicated Now: select layer, cmd + j = blank