Upload binary

I Uploaded successfully new binary app using application loader 2.9.1
i can see "submit for review" button. Every time I click it error message pop up on screen "you must choose a build"
there is no any available builds on page. Where it is? Option "build" is empty!

use this:
<%@ page language="java" import="java.sql.*,java.io.*,java.util.*, oracle.sql.*, oracle.jdbc.driver.*"%>
<%
String the_file = request.getParameter("the_file");
Driver dr =(Driver)Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@198.108.102.124:1521:VHPd","user","pass");
Statement stmt = con.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
FileInputStream instream = null;
OutputStream outstream = null;
BLOB myblob = null;
int bufsize=0;
int length = -1;
con.setAutoCommit(false);
stmt.executeUpdate("insert into news_xml values(20, empty_blob())");
ResultSet rset = stmt.executeQuery("SELECT file_content FROM news_xml where id=20 for update");
if (rset.next()) {
myblob = ((OracleResultSet)rset).getBLOB(1);
instream = new FileInputStream( new File(the_file));
outstream = myblob.getBinaryOutputStream();
bufsize = myblob.getBufferSize();
byte[] buffer = new byte[bufsize];
while ((length = instream.read(buffer)) != -1)
outstream.write(buffer, 0, length);
out.println("successful!!!");
instream.close();
outstream.close();
con.close();
%>

Similar Messages

  • How to upload binary file in database?

    Using servlets..how to upload binary file into database...
    How to get the data of file in servlet...
    Please reply...i'm unable to find exact code...that i want..

    You need to do two separate parts: accept the file from a HTTP multi-part POST and then stream it into a BLOB on the database. To do the former, download Jakarta Commons FileUpload. There is extensive documentation on how to write a simple handler for the upload. You then need to send the data to a BLOB. The specifics vary from database to database but generally you will insert or update a row with an empty blob, get a reference to the blob, pipe the data and then commit.
    If you do a quick forum search, this question has been asked (and answered) dozens of times. Some of the replies may even have code for you. Best of luck.
    - Saish

  • Upload Binary table to DMS

    Hi,
    Can anyone help me in uploading Binary table to DMS.
    Currently i am using BAPI 'BAPI_DOCUMENT_CRETE2' for creating DMS document but through this BAPI i can only upload documents from my presentation server.
    I will be having a PDF in binary table in my program and i want to upload that PDF to DMS.
    I am looking for a BAPI or Class method to upload the document to DMS from my binary table.
    can anyone help me?
    regards,
    Amit

    hello amit ..
    you can use CVAPI_DOC_CHECKIN to check-in data from internat table to DIR.
    Eg call as below :
    CALL FUNCTION 'CVAPI_DOC_CHECKIN'
                EXPORTING
                  PF_DOKAR           = DOKAR
                  PF_DOKNR           = DOKNR
                  PF_DOKVR           = DOKVR
                  PF_DOKTL           = DOKTL
                  PS_API_CONTROL     = ls_api_control
                  PF_CONTENT_PROVIDE = _*'TBL'*_
                IMPORTING
                  PSX_MESSAGE        = L_MESSAGE
                TABLES
                  PT_FILES_X         = lt_files_tab
                  PT_CONTENT         = LT_CONTENT.
    LT_FILES_TAB-APPNR = 1
    LT_FILES_TAB-DAPPL = TXT
    LT_FILES_TAB-FILENAME = test
    LT_FILES_TAB-STORAGE_CATEGORY = Y02L
    _LT_CONTENT_
    APPNR          ZAEHL          ORLN                                 ORBKL          ORBLK
    1     0001     000000007650     2550     <HEX_values>
    1     0002     000000007650     2550     <HEX_values>
    1     0003     000000007650     2550     0ABCDEF123456789
    Rgds,
    Shivanand

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

  • Upload binary probs

    I'm following iOS Publishing Companion Guide. I'm in the section on creating in-app purchases and on p68 it mentions out of nowhere "click Ready to Upload Binary". When I got to that point on iTunes Connect I couldn't find anything that binary was supposed to be so I saved what I'd done. Now my in-app purchases say "Waiting for upload", I can't find the "Ready to Upload Binary" button again and I'm still none the wiser as to where this binary might be that I'm supposed to upload. Been stuck here for a couple of days, re-tracing my steps to see if I've missed anythng. Any help much appreciated.   

    No, your binary is the .zip file. There are two download links in App Builder. The .ipa is your test app, the .zip is the submission app. Here's a link to our publishing guide for multi-issue folios: http://help.adobe.com/en_US/ppcompdoc/Adobe_Publishing_Companion_Guide_for_iPad.pdf
    Neil

  • How to upload binary through enterprise acccount...

    I cann't able to connect iTune,
    There is no option for iTune connect on member center page...
    I how i upload binary through enterprise account...
    My app is an in-House App..
    Thanks

    Sorry, but I don't understand the question. Can you please post back and explain further (preferably using full sentences with correct grammar and spelling)?
    Regards.

  • Upload binary file with DSEEntry

    Hi ,
    I have created a Class for a upload pictures to the IDM Database .
    Now I have the problem with the upload.... and the mssql datatype.
    At the moment the type is binary(max)
    is there any option to add a byte[] to DSEntry.put ?
    It seems that DSEntry always try a cast to string , and when put a byte[] I receive an exception.
    Regards

    Usually binary values are B64 or HEX encoded during processing in IdM. I take it you're trying to write it to a column of datatype binary, not an actual IdM attribute. Perhaps you should use varbinary(max) if you want to exceed 8000 bytes. But, the internal datatypes and the JDBC datatypes are not the same, so for SQL Server you need to use LONGVARBINARY.
    see this MicroSoft reference: Using Advanced Data Types
    Anyway, here's a working example. The $includebin function is documented in the helpfile but its usage is pretty self explaining in my example here:
    My table looks like this:

  • Upload binary files with Developer Forms

    Hi all,
    I'm newbie with Forms and I don't know if this question is already answered.
    I'm deploying an application involved with blob columns (binary files: pdf, doc, gif, etc) I want to let users to choose files from his PCs (typical "Browse files" button) but I don´t know if this is possible and if yes, how to implement it.
    Anybody can help me?
    My email is [email protected]
    Thanks in advance!
    Cristina

    If you want to upload direct into the database from the client then No you will need a 9i database or above.
    If you want to upload a file from the browser client to the middle tier (Application server) then that will be OK no matter what DB version you are using. Bug of course you'll then need to do the last bit yourself if you want the document / image put into the database.

  • Uploading Binary File

    Hi,
    I have all the server side stuff working and it receives ordinary file uploads from a form just fine.
    However, I now need to use a Java Applet instead of this HTML form and it all goes just fine except the binary file that appears on the server is missing it's 2K header.
    This is a very serious problem for me, as I have got to complete this ASAP.
    I have been trying to make this work now for 3 days and I cannot find a solution anywhere on the Internet.
    any thoughts?
    cheers
    Bruce

    My code currently is as follows, sorry all the indenting seems to have vanished after pasting the code in:-
    import com.ms.security.*;
    import java.lang.*;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.applet.*;
    public class urlFetch extends Applet {
    public void UploadFile(String serverURL,
    String serverFilePath,
    String clientFilePath,
    String filename,
    // Form values
    String func,
    String objType,
    String objAction,
    String parentId,
    String CTT_ID,
    String nextURL,
    String comment,
    String InheritRequired,
    String CREATE_Required,
    String CREATE_Edited,
    String CREATE_CacheID,
    String CREATE_CatNames,
    String name) {
    try {
              System.out.println("***Get Permission");
              PolicyEngine.assertPermission(PermissionID.FILEIO);
              System.out.println("***Create URL : " + serverURL);
              URL url = new URL(serverURL);
              System.out.println("***Create Connection");
              URLConnection conn = url.openConnection();
              String str = "";
              System.out.println("***Create data");
              str += "--" + BOUNDARY + NEWLINE;
              // Add all the values of the form data fields.
              str += _formData("func",            func);
              str += _formData("objType",         objType);
              str += _formData("objAction",       objAction);
              str += _formData("parentId",        parentId);
              str += formData("CTTID", CTT_ID);
              str += _formData("nextURL", nextURL);
              str += _formData("comment", comment);
              str += _formData("InheritRequired", InheritRequired);
              str += _formData("CREATE_Required", CREATE_Required);
              str += _formData("CREATE_Edited", CREATE_Edited);
              str += _formData("CREATE_CacheID", CREATE_CacheID);
              str += _formData("CREATE_CatNames", CREATE_CatNames);
              str += _formData("name", name);
              byte[] formData = str.getBytes();
              str = "";
    // add the file
              str += "Content-disposition: form-data; name=\"versionFile\"; filename=\"" + filename + "\"";
              str += "Content-type: application/msword" + NEWLINE;
              str += "Content-Transfer-Encoding: binary" + NEWLINE;
              byte[] fileHeader = str.getBytes();
              byte[] fileContents = _readFile(clientFilePath);
              str = "";
              str += NEWLINE; //This is the file content
              str += "--" + BOUNDARY + "--" + NEWLINE;
              byte[] fileFooter = str.getBytes();
              System.out.println("***Setup Request***");
              conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY);
              int lengthOfData = formData.length + fileHeader.length + fileContents.length + fileFooter.length;
              System.out.println("***Data Length : " + lengthOfData);
              System.out.println("***File Length : " + fileContents.length);
              conn.setRequestProperty("Content-Length", String.valueOf(lengthOfData) );
              conn.setDoOutput(true);
              conn.setUseCaches(false);
              System.out.println("***Get Output Stream");
              DataOutputStream os = new DataOutputStream(conn.getOutputStream());
              System.out.println("***Connect");
              conn.connect();
              System.out.println("***Send data");
              os.write( formData, 0, formData.length );
              os.write( fileHeader, 0, fileHeader.length );
              os.write( fileContents, 0, fileContents.length );
              os.write( fileFooter, 0, fileFooter.length );
              System.out.println("***Flush");
              os.flush();
              System.out.println("***Close");
              os.close();
    catch ( Exception e ) {
    System.out.println("***** Exception: " + e.toString());
    * Split a String on delimiters to return an array of the delimited Strings.
    * @param s The String to split up
    * @param d The delimiter on which to split s
    * @return Array of delimited Strings from s.
    private String[] _split(String s, String d) {
    StringTokenizer st = new StringTokenizer(s,d);
    String[] parts = new String[st.countTokens()];
    int i = 0; // Loop counter
    while (st.hasMoreTokens())
    parts[i++] = st.nextToken();
    return parts;
    * Create a String which is the HTTP representation of the field name/value pair
    * @param fieldName The HTML field name
    * @param fieldVal The (String) field value
    * @return A String to be used in the HTTP sent to the server.
    private String _formData(String fieldName, String fieldVal) {
    // return fieldName + " = " + fieldVal + NEWLINE;
    return "Content-Disposition: form-data; name=\"" + fieldName + "\"" + NEWLINE + NEWLINE
    + fieldVal + NEWLINE
    + "--" + BOUNDARY + NEWLINE;
    * Read the contents of filePath as a String and return.
    * @param filePath The full path to the file to be read
    * @return A string containing the contents of the file
    private byte[] _readFile(String filePath) {
         byte[] bytes;
         try {
              File fileIn = new File(filePath);
              FileInputStream fis = new FileInputStream(fileIn);
              bytes = new byte[ (int)fileIn.length() ];
              fis.read(bytes);
    /* my old one
              FileReader fr = new FileReader(filePath);
              int charsRead = 0;
              //my new bits
              File fileIn = new File(filePath);
              FileInputStream fis = new FileInputStream(fileIn);
              int size = ((int) fileIn.length());
              bytes = new byte[size];
              byte[] aByte = new byte[1];
              int n = 0;
              for (int i = 0; size > i; i++ ) {
                   charsRead = fis.read(aByte);
                   bytes[n] = aByte[0];
         ++n;
    /*          mick's original ***
              StringBuffer sBuffer = new StringBuffer();
              while (charsRead != -1) {
              charsRead = fr.read(BUFFER, 0, BUFFER_LEN);
              if( charsRead != -1 ) {
                   sBuffer.append(BUFFER, 0, charsRead);
    catch ( Exception e ) {
              bytes = new byte[1];
    System.out.println("***** Exception xxx: " + e.toString());
    // return sBuffer.toString();
         return bytes;
    * Private statics
    private static final String BOUNDARY = "BbC04y";
    private static final int BUFFER_LEN = 4096;
    private static byte[] BUFFER = new byte[BUFFER_LEN];
    private static final String NEWLINE     = "\r\n";

  • Upload Binary to Apple

    Now that apple only allows the app binary or ipa file to be uploaded using the Application Loader for mac is there anyway to do this in Windows?

    We received a similar warning:
    "ITMS-9000: This bundle is invalid. The value for key CFBundleVersion in the info.plist file must be a period-separated list of at most three non-negative integers. Version Mismatch. Neither CFBundleVersion nor CFBundleShortVersionString in the Info.plist match the version of the app set in iTunes Connect."
    Should we also ignore this warning?

  • Issue uploading binary: ERROR ITMS-9000

    Hello,
    I am unable to submit the binary I created using the app builder today because I keep getting this error:
    I updated my DPS App Builder this morning to the new version. I went through the same exact process with a different app yesterday before I updated and had no issues.
    I am a CC subscriber and this is for an update to an existing single-edition app. And I just updated all my certificates so that shouldn't be an issue.
    Any idea how to resolve this issue so I can submit my updates to Apple?

    Can you try going through the App Builder wizard again and getting a new .zip file? Then try uploading and see if it works.
    Neil

  • Gui_upload for uploading binary file

    Hello All,
    I am trying to upload '.jpg' files using gui_upload function.
    But something goes wrong and it dumps.
    I am new to ABAP.
    following is the code i used.
      DATA: xline TYPE xstring.
      DATA : t_file LIKE TABLE OF xline WITH HEADER LINE.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filetype = 'BIN'
          filename = 'C:\Documents and Settings\I046674\Desktop\RawTest\images\Image_1000.jpg'
        TABLES
          data_tab = t_file.
    It dumps in the 'GUI_UPLOAD' function itself.
    Saying follownig,
    ==========================================
    Error analysis
        The error occurred at a statement in the form
          ASSIGN f TO <fs> TYPE t
        One of these two cases occurred:
        1) Field f is a string, a data reference, an object reference, an
           internal table or a structure that contains such a field. With the
           TYPE addition, this is not possible.
        2) Field f is of type x and field symbol <fs> has a character-type type.
           When executing the statement, the length of f is not a multiple of
           the length (in bytes) of a Unicode character.
    ===============================================
    Can someone help me on this?
    Thanks & Regards,
    Abhijit

    hi,
    Master Data Documents Upload ABAP Program
    Re: Upload Master Data documents
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filename = 'c:\temp\text.txt'
    filetype = ' '
    IMPORTING
    filelength = fleng
    TABLES
    data_tab = text_tab
    EXCEPTIONS
    file_write_error = 1
    invalid_type = 2
    no_authority = 3
    unknown_error = 4
    OTHERS = 10.
    thanks

  • Struts commons binary file upload issue

    Hi,
    I was wondering if someone could help me with uploading binary files using jakarta commons file upload. I've looked at several examples and forums and it seems to work but sometimes the binary files that I upload get corrupted. I have no idea why this might be happening. Here is a snippet of my code.
        UploadFileForm uploadFileForm = (UploadFileForm)form;
        FormFile file = uploadFileForm.getFile();
        String dirName = "/tmp/";
        InputStream inputStream = null;
        OutputStream bos = null;
        inputStream = file.getInputStream();
        bos = new FileOutputStream(dirName + file.getFileName());
        int bytesRead = 0;
        byte[] buffer = new byte[4096];
        while ((bytesRead = inputStream.read(buffer, 0, 4096)) != -1) {
            bos.write(buffer, 0, bytesRead);
        }            Am I doing something wrong?
    Thanks.
    PV

    FormFile myFile    = myForm.getTheFile();
        byte[] fileData    = myFile.getFileData();
        BufferedReader in = null;
       try{
           in = new BufferedReader(new InputStreamReader(new   ByteArrayInputStream(fileData)));
           // in = new BufferedReader(new  InputStreamReader(myFile.getInputStream()));
           String str;
            while ((str = in.readLine()) != null) {
                    System.out.println(str);
       }catch(Exception exp){
           exp.printStackTrace();
        }finally{
             if(in != null){
                try{
                   in.close();
                }catch(Exception ep){
                       ep.printStackTrace();
        } Hope this might help :)
    and a small advice please do reactivate archived posts.It'd be lot better if you start with a new one.
    Hope there are no hard and fast issues on this.
    REGARDS,
    RaHuL

  • WLS 5.1 w/sp8 garbeling binary files when uploaded.

    I have implemented multiple methods of handling file uploads in servlets.
              I have tried the Marsh:
              http://sourceforge.net/projects/marsh/
              and the Oreilly com.oreilly.servlet:
              http://www.servlets.com/cos/index.html
              helper libraries as well as my own code, yet I still have the same problems.
              For some reason some bytes in binary files are being converted to ascii '?'s
              instead of the proper bytes. All uploaded files from all three
              implementations contain the same error, yet no bugs are listed in any of
              them (even Weblogic.)
              I am running WLS 5.1 SP8 on Windows and Linux and am having the same errors
              on both. If you might be thinking it's the way I'm writing the file then
              here is how I am outputing (once I get an input stream from the
              HttpServletRequest).
              /* Code snippet */
              x = myinput_stream.read();
              while(x >= 0) {
              myfile_writer.write(x);
              x = myinput_stream.read();
              myfile_writer.close();
              /* End code snippet */
              If you know how to fix this or you have gotten WLS to upload binary files at
              all then please reply and let me know.
              

    I'll try that and then let you know....
              "Dimitri Rakitine" <[email protected]> wrote in message
              news:[email protected]...
              > Writer's are for character streams - it will work if you use OutputStream
              > to write to a binary file.
              >
              > Hoopy Hacker <[email protected]> wrote:
              > > I have implemented multiple methods of handling file uploads in
              servlets.
              >
              > > I have tried the Marsh:
              >
              > > http://sourceforge.net/projects/marsh/
              >
              > > and the Oreilly com.oreilly.servlet:
              >
              > > http://www.servlets.com/cos/index.html
              >
              > > helper libraries as well as my own code, yet I still have the same
              problems.
              > > For some reason some bytes in binary files are being converted to ascii
              '?'s
              > > instead of the proper bytes. All uploaded files from all three
              > > implementations contain the same error, yet no bugs are listed in any of
              > > them (even Weblogic.)
              >
              > > I am running WLS 5.1 SP8 on Windows and Linux and am having the same
              errors
              > > on both. If you might be thinking it's the way I'm writing the file
              then
              > > here is how I am outputing (once I get an input stream from the
              > > HttpServletRequest).
              >
              > > /* Code snippet */
              > > x = myinput_stream.read();
              > > while(x >= 0) {
              > > myfile_writer.write(x);
              > > x = myinput_stream.read();
              > > }
              > > myfile_writer.close();
              > > /* End code snippet */
              >
              > > If you know how to fix this or you have gotten WLS to upload binary
              files at
              > > all then please reply and let me know.
              >
              > --
              > Dimitri
              

  • How to upload large binary data to dB so it can be read by any app?

    Hi everyone,
    Short version: how do you upload binary data into a MySQL blob field in such a way that it can be read by any application?
    Long version:
    I've been struggling with the problem of putting files into database BLOB fields. (MySQL and Database Connectivity Toolkit).
    I was initially building a query string and executing the query but was finding that certain binary characters were causing failures (end of string terminators, etc...) So, a working solution was to encode the binary string, and that worked fine, although bloated the dB a fair bit. I could decode in LabVIEW and then save the file as needed.
    Now, the customer wants to be able to save the files using other apps, including the MySQL Query Browser, so an encoded file is no good.
    I found using a parametrized query allows me to put the unencoded string into the dB, but it appends a 4-byte length at the front of the BLOB before it inserts it into the dB. Some apps ignore these 4-bytes (such as .pdf) but most do not.
    A related thread on NI discussion forums: http://forums.ni.com/ni/board/message?boar...ssage.id=354361 has no solution, and my support ticket at NI has been ongoing without answer for a while.
    Thanks,
    Ben

    The problem is the DCT. Using ADO it is fairly easy to insert binary data into a BLOB field. I have not tried it in MySQL, but it works fine in SQL Server, Oracle, Firebird and other free/open source databases I have tried. To get you started, see this thread.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Maybe you are looking for

  • How do I change channels from rgb to one at a time in different layers

    I need some help on how to change between the 3 colors without it reverting back to rgb

  • Can we create a precalculated workbook?

    Actually i know that we can create a precalculated workbook in web template but in BEx Analyzer is there a possibility of creating precalculated  workbook.???

  • Change work center

    Hi all, Please excuse my ignorance in what is probably an easy operation. What is the transaction code for changing a work center that a production order is setup default to be completed in? For example if i have product 'A' that is usually completed

  • Windows 8 booted up high memory used

    Just got this Samsung series 9 with Windows 8, 8 GB memory and 256 GB SSD drive. When the system boots up, go into Task Manager. The initial memory is at 13% used, after about 30 seconds. It surged all the way to 75% used while I am watching. I have

  • Safari crashes when asked to load a PDF file

    Running Safari 2.0.4 on a Mac Pro. When a URL points to a PDF and I try and open it, or when a mail message has a url to a PDF, Safari crashes without a message other than the "Would you like to report this to Apple"? Any ideas? I have tried resettin