Storing binary data to a file......

Hi Friends,
I am trying to make a webapp in which users can upload Videos and I can store that videos on the server. I have this bit of code:
    public ActionForward execute(
            ActionMapping mapping,
            ActionForm form,
            HttpServletRequest request,
            HttpServletResponse response) throws Exception{
                    VideoUploadForm myForm = (VideoUploadForm)form;
                    // Process the FormFile
                    FormFile myFile = myForm.getTheFile();
                    byte[] fileData    = myFile.getFileData();
  }My question is, should i store the byte array into some text file???Then how can i read it back and get the original format i.e *.avi or *.mpg.
This might be easy,but this is my first time dealing with binary data,so your help would be appreciated.
Thanks
P.S: Any links would be appreciated

Thanks BalusC,
After lots of hardwork finally I am trying to upload the binary file in the database,but getting this error:
java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, file_blob) values(1, 1, 'uploaded file from user', _binary'\0\0�!\0\0�\' at line 1
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2994)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:936)
        at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:773)
        at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:168)This is my code thats trying to write that binary file:
public class StoreData {
    private static Log log = LogFactory.getLog(StoreData.class);
    private static final String INSERT_BLOB = "Insert into videos.files (id, owner_id, desc, file_blob)" +
                                              " values(1, 1, 'uploaded file from user', ?)";
    public void WriteData(VideoUploadForm myForm){
        log.info("Writing file to database");
        Connection conn = ConnectionUtil.getConnection();
     PreparedStatement stmt = null;
        // Process the FormFile
        FormFile myFile = myForm.getTheFile();
        byte[] bytes = null;
        try{
            bytes = myFile.getFileData();
        }catch(IOException ie){
            log.error("Upload File not Found");
            ie.printStackTrace();
        InputStream is = new ByteArrayInputStream(bytes);
        try {
            stmt = conn.prepareStatement(INSERT_BLOB);
            stmt.setBinaryStream(1,is,bytes.length);
            stmt.execute();
            stmt.close();
        }catch (Exception e) {
            log.error("Error writing data to file:");
            e.printStackTrace();
     } finally {
         ConnectionUtil.closeStatement(stmt);
         ConnectionUtil.closeConnection(conn);
}Looking for some help here.....

Similar Messages

  • Writing binary data to a file without carriage returns every 512 bytes

    Is there a VI for writing binary data to a file without carriage returns being inserted every 512 bytes?
    Thanks

    Hi Momolxg,
    I could be way off on this. I tried to simulate what you've done by
    making a for loop that would run a set number of times. For my example I
    used 1025. I wired the iteration terminal to a 'Write to SGL File.vi'
    outside the loop with indexing enabled. It wrote the SGL data from 0 to
    1024 to the file. I then read the file with a 'Read Characters from
    File.vi' and searched the output for a carriage return (0D hex). It was
    found five times. The reason why was the SGL number it was reading had a
    13 (0D hex) in it. Perhaps you're running into a similar problem?
    I tried it again, this time using the 'Write to I16 File.vi'. The
    carriage return was found five times: the 28th character the first time
    then on the 512th character four consecutive time
    s after that. I suppose
    that makes sense that you'd find a 0D in the numbers at equal spacings if
    they're incrementing this way... In this case the carriage returns you're
    seeing are actually numbers from your data.
    One big difference is that I'm using a set pattern of numbers. This
    doesn't appear to be your case. Is there a better way we can duplicate
    your problem? It sounds interesting. Again my simulation could be way
    off. (I'm also running this on LV60 for Linux so my results could be
    different)
    - Kevin
    In article <[email protected]>,
    "momolxg" wrote:
    > Is there a VI for writing binary data to a file without carriage returns
    > being inserted every 512 bytes? Thanks

  • How to extract binary data from a File?

    Hello there!
    Hope I'm right here.
    I have a slight problem with a file containing text- and binary-data. At the beginning of the file is only some text followed by some html-code and at the end is some binary stuff like a pdf oder an image (jpg/gif).
    My problem is now how to split these parts and save them in the suitable format. The text and the html are no problem, but I don't know how to extract the binary data. I tried it out with an Inputstream, but I don't know how to find the exact position where the binary data begins.
    Anyone have an idea how I can solve this?
    Thanks in advance and sorry for my bad english.

    I don't believe a bullet-proof solution exists.
    If you know where the HTML ends, you may skip whitespace and then assume the rest is binary data. Or, if you know the first bytes of the binary data, you may locate those. With either of these solutions, though, you risk coming across a file where it doesn't work as expected, for example if the first byte of the binary data happens to match a whitespace character.

  • How to append binary data to existing file in OSB

    Hi,
    I have an OSB project that I need for it to append binary data via ftp.  Here's my current flow:
    MFL binary output --> Replace $body with mfl binary output --> Publish to action (Business service that's configured to ftp binary data).
    However, when the data is ftp'ed the following error is thrown:
    URI = ftp://xxx:21/opt/home/zzz/logs
    Request metadata =
        <xml-fragment>
          <tran:headers xsi:type="ftp:FtpRequestHeaders" xmlns:ftp="http://www.bea.com/wli/sb/transports/ftp" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:xsi="h
    ttp://www.w3.org/2001/XMLSchema-instance">
            <ftp:fileName>11802_insert_oh_xfrmr.eai_data</ftp:fileName>
          </tran:headers>
          <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
          <ftp:isFilePath xmlns:ftp="http://www.bea.com/wli/sb/transports/ftp">false</ftp:isFilePath>
        </xml-fragment>
    Payload =
    19266787^CLLL^C711791^CLLL^C^C1178213^CSingle Phase(1)^C63185066204^CA^CConstructed^C358880 NW 4 DR LK MONTAZA^C120/240^C09361^CN/A^CProposed Remove^CAerial^C45718100^C
    Unknown^C^CNo^CNormal Closed^CClamp^CA^C1^C2-Cover^C19266796^CNo^CNo^C15^C^CYes^CYes^CYes^C13200Y/7620 X 22860Y/13200^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C
    ^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C19266641^Coh_fuse_switch^C63086930001^C4^CN31^CDD0613^C22.9^C63376474601^C8129580^CFalse^C4^COke
    echobee^C43^C0^Cdefault^CYes^C
    >
    ####<Nov 6, 2013 2:28:23 PM EST> <Error> <WliSbTransports> <goxsd1604> <osb_server1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <<
    anonymous>> <BEA1-4B688443B66FA09FFE75> <d2b4601b2fffd9b7:6b9f2297:1422a857ee8:-8000-000000000000171b> <1383766103889> <BEA-381105> <Error occured for the service endpo
    int: com.bea.wli.sb.transports.TransportException: Unable to open data connection. Message is Received error response (553) from FTP server [mpsd1] IP [10.111.19.32] po
    rt [21] status [connected] upon executing command [stor opt/home/zzz/logs/11802_insert_oh_xfrmr.eai_data.a]
    com.bea.wli.sb.transports.TransportException: Unable to open data connection. Message is Received error response (553) from FTP server [mpsd1] IP [10.111.19.32] port [2
    1] status [connected] upon executing command [stor opt/home/icanadm/logs/11802_insert_oh_xfrmr.eai_data.a]
            at com.bea.wli.sb.transports.ftp.connector.FTPTransportProvider.sendMessage(FTPTransportProvider.java:422)
    From what I understand the error code 553 represents a bad file name.  The file name that I'm supplying is 11802_insert_oh_xfrmr.eai_data but it appears that the name is changed to 11802_insert_oh_xfrmr.eai_data.a .  So I did the obvious and changed the file several different ways (without the .eai_data extension, removed the numbers from the file name) but still no luck. 
    Any suggestions?
    Thanks,
    Yusuf

    Thanks Eric.
    I'm using the JCA FTP adapter instead and noticed it's appending the test generated data supplied by the OSB test console.
    However, how can I ensure that the MFL output that I need to append will be placed on a new line? 
    Also, how should I map/assign the MFL binary output to the opaqueElement type base64Binary defined in the WSDL file below?
    Once again here's a sample payload that I need to ensure will be presented on a new line:
    19266787^CLLL^C711791^CLLL^C^C1178213^CSingle Phase(1)^C63185066204^CA^CConstructed^C358880 NW 4 DR LK MONTAZA^C120/240^C09361^CN/A^CProposed Remove^CAerial^C45718100^C
    Unknown^C^CNo^CNormal Closed^CClamp^CA^C1^C2-Cover^C19266796^CNo^CNo^C15^C^CYes^CYes^CYes^C13200Y/7620 X 22860Y/13200^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C
    ^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C19266641^Coh_fuse_switch^C63086930001^C4^CN31^CDD0613^C22.9^C63376474601^C8129580^CFalse^C4^COke
    echobee^C43^C0^Cdefault^CYes
    Here's the WSDL file that gets generated for the FTP adapter:
    <wsdl:definitions
         name="PutGenericDevice"
         targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/ftp/AMS/Project1/PutGenericDevice"
         xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"
         xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
         xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/ftp/AMS/Project1/PutGenericDevice"
         xmlns:opaque="http://xmlns.oracle.com/pcbpel/adapter/opaque/"
         xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
        >
      <plt:partnerLinkType name="Put_plt" >
        <plt:role name="Put_role" >
          <plt:portType name="tns:Put_ptt" />
        </plt:role>
      </plt:partnerLinkType>
        <wsdl:types>
        <schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/opaque/"
                xmlns="http://www.w3.org/2001/XMLSchema" >
          <element name="opaqueElement" type="base64Binary"/>
        </schema>
        </wsdl:types>
        <wsdl:message name="Put_msg">
            <wsdl:part name="opaque" element="opaque:opaqueElement"/>
        </wsdl:message>
        <wsdl:portType name="Put_ptt">
            <wsdl:operation name="Put">
                <wsdl:input message="tns:Put_msg"/>
            </wsdl:operation>
        </wsdl:portType>
    </wsdl:definitions>
    Here's the JCA details:
    <adapter-config name="PutGenericDevice" adapter="FTP Adapter" wsdlLocation="PutGenericDevice.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
      <connection-factory location="eis/ftp/DssPut"/>
      <endpoint-interaction portType="Put_ptt" operation="Put">
        <interaction-spec className="oracle.tip.adapter.ftp.outbound.FTPInteractionSpec">
          <property name="PhysicalDirectory" value="/opt/eai/ofmw/Oracle/Middleware_R7/logs"/>
          <property name="FileType" value="binary"/>
          <property name="Append" value="true"/>
          <property name="FileNamingConvention" value="dummy.txt"/>
        </interaction-spec>
      </endpoint-interaction>
    </adapter-config>
    Thanks,
    Yusuf

  • Sample code converting binary data to image file

    Hi experts ,
    I need sample code to convert binary data (bytes) in to an image file.
    any help will be appreciated.
    Thanks and Regards,
    Naresh

    You need to show binary and decimal?  Or now just decimal?
    If binary and decimal, you can right click on your indicator and choose "Display Format...".  If you select the Advanced Editing Mode, you can make soft interesting display formats.  This includes showing the same value in mulitple ways in the indicator.  Try something like "%032b - %d" for the format string.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Writing binary data to ASP file from applet through URLConnection

    Hi Everybody,
    I am facing a proble with HttpURLConnection.I want to write some binary data from applet to an ASP file.The other end ASP file read this binary data and process , Here problem is I have opened URLConnection to the page and Created OutputStream and writing byte by Write() method But other end we are not getting bytes...we are not getting error too at java side..can any body help me..do we need to set any property to URLConnection...here I am giving sample code...
    OutputStream os;
    URL uConnect2;
    HttpURLConnection hucConnect2;
    uConnect2= new URL("http://webserver/vnc/sendtoserver.asp?"); hucConnect2=(HttpURLConnection)uConnect2.openConnection();
    hucConnect2.setDoOutput(true);
    hucConnect2.setRequestMethod("POST")
    os=new DataOutputStream(hucConnect2.getOutputStream());
    os.writeBytes("Hello");
    Thanks in Advance
    Madhav

    Do you remember to flush() and close() the stream?

  • How to write binary data to browser - File Save dialog

    Hi,
    problem:
    i have a working webservice and i get binary data from that webservice.
    my dynpro java  already works and i have byte[] b which has my binary result.
    what i want:
    when the user clicks on the button, the action onActionGetResult() is executed and inside this method, the byteArray b exists. what can i do, to say the dynpro application that it should  send the binary data direct to the browser, so that the "File Save Dialog" appears and the user can save the file to the harddisk
    any ideas?

    I've found the solution:
    IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(
    res.getUrl(WDFileDownloadBehaviour.ALLOW_SAVE.ordinal()),
    res.getResourceName());
    window.show();
    this worked for me

  • ABAP XSL mapping - Binary data of attached file

    I have a webservice which is converting attachment and putting it into XSLT Node. when I mapped this node to Attachment payload of my partner (using ABAP xsl mapping), I got an error.
    I was able to send the same file via SOAP UI...
    On further investigation of the http log files, I noticed that Binary data for both streams looked same, but when I did a word count, I noticed that SOAP UI was a single line file while my PI data was more than 400 lines.. so I coded a fn:transfer of this data to convert end of line character to empty value. it did seem to work...
    My question, is this approach correct? or is there any way to ensure binary data stream in XML node does not contain those additional characters?

    can you provide input xml
    Edited by: RajuGA on Dec 7, 2011 2:09 PM

  • Write RAW buffer (binary data) to OS file

    Hi there,
    It is easy to insert BLOB data into a BLOB-column of a table from a BFILE. But how can a do the other way around? That means:
    Read the BLOB (maybe into a variable 'buffer RAW(...)') and write it into a binary file? As I know, the UTL_FILE package only supports ascii files.
    The following demo example works to display the raw-data on the screen:
    CREATE OR REPLACE PROCEDURE displayLOB_proc IS
    Lob_loc BLOB;
    Buffer RAW(255);
    Amount BINARY_INTEGER := 255;
    Position INTEGER := 1;
    BEGIN
    /* Select the LOB: */
    SELECT Photo INTO Lob_loc
    FROM testblob WHERE id = 1;
    /* Opening the LOB is optional: */
    DBMS_LOB.OPEN (Lob_loc, DBMS_LOB.LOB_READONLY);
    LOOP
    DBMS_LOB.READ (Lob_loc, Amount, Position, Buffer);
    /* Display the buffer contents: */
    DBMS_OUTPUT.PUT_LINE(utl_raw.cast_to_varchar2(Buffer));
    Position := Position + Amount;
    END LOOP;
    /* Closing the LOB is mandatory if you have opened it: */
    DBMS_LOB.CLOSE (Lob_loc);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT.PUT_LINE('End of data');
    END;
    What should be inserted instead of DBMS_OUTPUT.PUT_LINE(...).
    Please help
    Peter

    >I have discovered that I just posted the same question.
    Please annote your other post as such.
    >Does DBMS_UTIL 9.2 run under Oracle 8i?
    UTL_FILE (not DBMS_UTIL), and 9.2 = Oracle9i Database Release 2. So, no. You will need to implement an external procedure via c or java to get you home with 8i. Search this forum (as best as you can) for the multitudes of such solutions.
    >Where can I locate some of the sameple code that you mention?
    I have none handy, yet. You can read all about it @ http://tahiti.oracle.com
    Michael O'Neill
    Publisher of the PigiWiki
    clever-idea.com

  • Problem: Storing binary data in Xml Cdata section

    The objective : Tranport image using xml
    1. I convert the image to input stream.
    2. store it in an array.
    3. encode the string using Base64 library and get a string
    4.then i store it in xml CDATA section.
    the code snippet is
    public class ImgToXml01 {
         public static void main(String[] args) throws IOException
              File inputFile = new File("C:\\Arup\\ImgXml\\read\\Sample.jpg");
              FileInputStream in = new FileInputStream(inputFile);
              String str="";
              int c;
              while ((c = in.read()) != -1) {
              str+= ""+c;
              String val = util.Base64.encode(str);
              System.out.println(""+val);
              OutputStream fout = new FileOutputStream("img.xml");
              OutputStreamWriter out = new OutputStreamWriter(fout);
              out.write("<?xml version = \"1.0\" encoding = \"ISO-8859-1\"?>\r\n");
              out.write("<Image>\r\n");
              out.write("[CDATA["+val+"]]");
              //out.write("]]>");
              out.write("</image>\r\n");
              out.close();
    When i retrieve it i write the code:
    import org.xmldb.api.base.*;
    import org.xmldb.api.modules.*;
    import org.xmldb.api.*;
    import org.w3c.dom.*;
    import java.io.*;
    import org.xml.sax.SAXException;
    import oracle.xml.parser.v2.*;
    public class CdataToImage01 {
         public static void main(String[] args) //throws IOException
         try{
         String uri="c:\\Arup\\ImgXml\\img1.xml";
         String data="";      
         File file = new File(uri);
         FileInputStream fis = new FileInputStream(file);
         BufferedInputStream in = new BufferedInputStream(fis);      
         DOMParser parser = new DOMParser();
         parser.parse(in);      
         Document doc = parser.getDocument();
         Node r = doc.getElementsByTagName("Image").item(0);          
         NodeList kids = r.getChildNodes();
         if ( kids != null )     {
              for ( int i = 0; i < kids.getLength(); i++ ) {
                   if ( (kids.item(i).getNodeType() == Node.TEXT_NODE) ||
                             (kids.item(i).getNodeType() == Node.CDATA_SECTION_NODE)) {
                             data=kids.item(i).getNodeValue();
              String data1 = util.Base64.decode(data);
              File outputFile = new File("Sample.jpg");
              FileOutputStream out = new FileOutputStream(outputFile);      
              byte[] buff = data1.getBytes();
              InputStream inn = new ByteArrayInputStream(buff);
              int c;
              System.out.println(buff.length);
              while ((c = inn.read()) != -1) {
              out.write(c);
              inn.close();
              out.close();
         catch (SAXException e) {
              System.err.println(e);
              e.printStackTrace();
         catch (Exception ex){
              System.err.println("Exception occured " + ex.getMessage());
              ex.printStackTrace();
    But i am not getting the appropriate result .I get a corrupted image.
    FROM
    ARUP GHOSH

    String str="";
    int c;
    while ((c = in.read()) != -1) {
    str+= ""+c;
    }Your problem is here.
    Let's suppose you just have a trivial 3-byte file containing the bytes 27, 55, and 126. Your program will convert that into the string "2755126". Then you base-64 encode it, etc etc, then you base-64 decode it and (hopefully) produce the same string "2755126". Converting this string to bytes and writing it to a file produces a 7-byte file containing the bytes 50, 55, 53, 53, 49, 50, and 54. Not the same at all. You could prove this to yourself by putting in some debugging statements.
    I don't know how to suggest a fix because it looks to me as if your base-64 utility takes a String as its input. It should take an array of bytes, or an InputStream.
    PC&#178;

  • Storing cluster data in a file

    I have a cluster array of numeric indicators.
    How to store this data in an excel format?(or anyother format from which I can read the data back) I use Version 6.0
    Veena

    If your purpose is to simply restore a previous set of values from one session to another, or to provide a choice of different data sets, your easiest method is a flattened string file.
    Just wire your cluster array into the Flatten To String function and into Write Characters To File VI.
    To read the file, just wire Read Characters From File into Unflatten From String. Use the empty cluster array indicator as the data type.
    Another option is to write an XML file, but that requires LV61 or the OpenG toolset.
    Michael Munroe, ABCDEF
    Certified LabVIEW Developer, MCP
    Find and fix bad VI Properties with Property Inspector

  • Horizontal scaling, with large amounts of binary data

    question about horizontal scaling. tried asking late last night, but no one was active. Basically, I have an app that needs to scale (by adding new machines all talking to a database in the backend). This is all fine, but I have some binary file storage requirements for the app (files over 80 megs in size). This introduces a concurency issue, as I can't store this binary data on any of the individual server (because then it will be on one, and not all, leaving the app in an inconsistent state). So where do I store the data to enforce a consistent state? Have the individual apps FTP the file to a central location?
    I am trying to avoid storing binary data in the database; Does anyone have any suggestions on how to address this problem?

    I understand why you are trying to avoid storing binary data in a database but if you need to ensure that this data cannot be modified without the appropriate restrictions then using a database might make sense. You could even have a separate database just for the binary data because you will need to ensure you get the block sizing correct. Also, some databases might be better than others in this case. For example Oracle is likely to be significantly better than MySQL.
    If you do want to use files then you need to put the file in a central location and enforce locking the file to prevent concurrent modification. You can probably tie into a protocol that automatically handles this for you.

  • Best Datatype for Binary Data

    Hi,
    We storing a Binary Data say "€ù?" in oracle as String Datatype.
    I have formed the query in my application to insert a record which has above string as one of the String field value.
    The insertion was success but when the above string is not stored as it is but it is stored as "¿ù?" which is not a correct data.
    Is this problem is because I'm using string for storing binary data?
    Also please let me know what could be the best data type to store the binary data (like above data) in oracle.

    Justin,
    With the help of your query I identified how the bytes are stored in the memory.
    I'm having VARCHAR2 datatype of size 14 in oracle when ever i store my binary data it is storing as
    127,0,0,0,0,0,0,0....for 14 bytes -> So the binary equivalent is 011111111,00000000,00000000,...... And i'm ok with it.
    But the problem is whenever a byte is holding the binary equivalent of 128 it is storing in the oracle as 191
    eq:
    Bits: 10000000 => equivalent to 128 in decimal and it is what i want to get when i query it using select, but what i'm getting in sql query is "191".
    Really I'm not able to understand the relationship beween 128 and 191 binary values.
    I got the above detail using the DUMP sql function.

  • SAP DMS: Read document binary data stored in a 3rd party repository

    Hi,
    I'm totally new regarding SAP DMS and I'm a bit confused about what can or can't do, so maybe the question will be quite generic and unclear.
    The scenario in my company is that we have multiple repository servers where we store our documents. When a document is created or modified in one of these repositories a new record is also created/modified in SAP DMS, but this DMS entry only contains the basic metadata information and a URL link to the document, not the content. When the user is in SAP DMS, the only way to access the document content, is via the link that will open the browser outside of SAP GUI and access the repository data using the laptop credentials.
    I would like to know if DMS provides some kind of interface to be able to access the document content from SAP. Now we only have this unidirectional interface from the repository that creates the record in DMS with the metadata but there is nothing to retrieve the content.
    Our main purpose is that we want to download all the files linked to a user (we have a logic to determine if a DMS file is linked to a user). The content of these files may be stored in different content repositories. So I would like to read the binary data in SAP from the different repositories and then be able to download it.
    Thank you in advance for your help.
    - Marçal

    Hi Sagar,
    This FM can't work since there is nothing configured in SAP to access to the file content. The DMS record only has a URL pointing to it.
    Actually what I want to know is what do I have to configure in SAP in order to be able to use a FM like the one you mentioned.

  • To attach/upload binary data file(to vendor) from EP(sends from) to abap

    Hi All,
    I have requirement Enterprise portal(JAVA) will send the file data in binary format to abap.we have to attach the binary data(file) to content server.
    that is for vendor/custmer(XK02/XD02) will have attachments in the sap screen.
    similarly the above screens are provided using enterprise portal (using java) also attachment feature also needs to provide.
    so whenever user imports file form EP screen, they will convert the file into binary format and sends to abap through proxy(custom proxy) abap should attach the binary file to vendor/customer.
    I have checked so_object_upload,so_object_insert, binary relation create --  these FMs are helped using dialog box or providing the path of the file. but couldnt use when the file is in binary format and if it sent form proxy interface.
    could anyone help me in resolving the requirement to upload binary data.

    I use "call function 'ARCHIVOBJECT_CREATE_TABLE'" to process a binary table.  However, in my situation, I'm storing in Documentum.  Once that FM completed, I follow up with call function 'ARCHIV_CONNECTION_INSERT' to store the reference to the document and the archived object in SAP tables.  In your case, you need something that processes the binary table, or you need to utilize one of the "SCMS* " function modules to put your binary table into something that you can use with the other functions.
    The upload from desktop can be done using BIN filetype for GUI_UPLOAD class or function module, or from apps server, you can read your file into an xstring with open dataset....in binary mode....read dataset into your xstring, close dataset.

Maybe you are looking for

  • ALV help on summing

    Hi, I have a report which will display the costing data. Now I have to sum on the Basis of Cost Centre and Profit Centre. I do not want the total. I want the line items to be summed on this 2 fields. How would I handle this in ALV Fieldcatalogue. Reg

  • EDI Receiver Id's in XI

    While doing XML mapping for EDI messages, Where we will keep all the EDI sender/receiver Id in XI.

  • Passive Sentences always returns 0 in Readability Stats - Word 2013

    Is there are workaround for the Passive sentences issue in Readability stats? I have seen this issue mentioned going back over several years, but no working answer. The following code always returns zero, but grammar checker does not: Sub Stats()    

  • Help me squash this bug please

    Post Author: eseidel CA Forum: General Hi, Im using VS2005 CR.  After playing around with my program for a while I think I have discovered a bug. I just don't know if it's me or Crystal? When I run the program and set the parameters and then generate

  • Error when trying to download purchased items

    Hello, when I am trying to download my purchased items, I get an error message "Unable to check for available downloads The itunes store is temporally unavailable. Please check again later." I can use the store however. When I ran itunes network diag