Store a uploaded file of type binary into a java.sql.Blob

Hi all,
I try a File-Upload and store the file in a  java.sql.Blob of a MaxDB.
My Problem is, that I'm not able to import a Model-Attribute of data type byte[]. Further I don't no how to convert the uploaded value attribute of data type binary, in a java.sql.Blob.
Regards,
Silvia Hofmann

http://www.excelsior-usa.com/jet.html
http://www.ej-technologies.com/products/exe4j/overview.html
http://jsmooth.sourceforge.net/
Distributing your Application as an executable JAR file
Google is your friend.

Similar Messages

  • Upload file of type Spreadsheet.ods  to internal table

    Hi Experts,
    can any body give me function module to upload file of type Spreadsheet.ods  into internal table
    Thanks in Advance
    Narendra

    Hi Renu,
    it is not supporting this function modules.
    we r using open office and its just like excel sheet.
    even function module ALSM_EXCEL_TO_INTERNAL_TABLE
    not supporting.
    Narendra

  • I store my upload file at server0 location.Now i want to display it how?

    Hi,
    I store my upload file at server0 location. Now i want to display it how it is possible.
    Regards,
    Gurprit Bhatia

    Hi Gurprit,
    If you want to open or save the uploaded file on local PC then follow below steps:
    1. Take a "FileDownload" UI element
    2. Create Resource type value attribute and bind it to resource property of "FileDownload" UI element.
    3 Write the below code in wdDoInit() method:
    IWDResource resource =
    WDResourceFactory.createResource(new FileInputStream(new File("D:\\usr\\sap\\EPD\\JC00\\j2ee\\cluster\\server0", "Test.txt")),
                             "Test.txt",
                             WDWebResourceType.UNKNOWN,
                             true);
    Hope this will help you.
    Thanks
    Sandy

  • Get Uploaded File Mime Type and Client Filename

    Anyone know how to recover an uploaded file MIME type and
    client file name?
    I'm writing my own cfx tag to process file uploads and pretty
    much have it figured out except to determine the name of the client
    file and mime type. The formfield file variable value contains the
    path/filename to the CF temp directory, but I need the MIME type,
    filename, etc. that is contained int he HTTP Header
    (e.g. Content-Disposition: form-data; name="Image";
    filename="C:\test.JPG"
    Content-Type: image/pjpeg
    [empty line])
    I'm using the getHttpRequestData() functiont, but it only
    gives me the content-type multipart/form-data, leaving out the Mime
    type and Content-Disposition (which contains the client file name).

    Hi Daniel,
    do you use EPG, mod_plsql or APEX Listener? Have you changed the connection mechanism after upgrading to 4.2.1?
    If you use the APEX Listener, which version do you use? Which browser and version do you use to upload the file? Does it reproduce with other browsers as well?
    Regards
    Patrick
    Member of the APEX development team
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • MDO Query errors in log -[Cannot fetch column 22, which has JDBC type DOUBLE, into a Java variable of type ]

    Hello,
    We are seeing a lot of log messages like the one below when an MDO select query is run. There is a message for every numeric column. There doesnt seem to be any issue with the queries working properly its just creating a lot of log messages. Has anyone else had this issue?
    Exception of type com.sap.sql.log.OpenSQLException caught:
    Cannot fetch column 22, which has JDBC type DOUBLE, into a Java variable of type
    float..
    [EXCEPTION]
    com.sap.sql.log.OpenSQLException: Cannot fetch
    column 22, which has JDBC type DOUBLE, into a Java variable of type float.
    at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:83) ...

    Hi Christian,
    You are right. As in your case it is a select query it does not reflect the error automatically. In my case, I had an insert query so it failed then and there, which was easier to debug and fix.
    I have one question regarding your case. When you read the MDO using the query, what do you do with the output? Do you assign it to any local/transaction property in the output links of the query block or in a proceeding assignment block?
    Because, the error mentions that the assignment of float to double datatype fails. So, in theory there should be some assignment done with the output.
    Please check if you could figure out this part in your transaction.
    Regards,
    Saumya Govil

  • Uploading files Mime Type not correct for Office 2007 default extensions.

    hi all,
    My company has recently moved over to MS Office 2007 and the default extensions for word, excel etc are now .docx, xlsx etc (ie xml based).
    Unfortunately now when we upload files through APEX to the database the MIME TYPE value for these files isn't being recognised and not loadeding correctly into the APEX_APPLICATION_FILES table and subsequently any future retrieval of these files fails.
    I could put some logic inthe up load procedure to look at the filename in APEX_APPLICATION_FILES and hard code in the releavnt mime types but this still causes problems when retrieving the content.
    Has anyone come across this and got a workround? Is it a bug in AE?
    regards
    James
    FYI - using APEX 3.0.2 over 11G.

    I have not any response to my question and not sure if it is in Apex I need to look or the tomcat server that I need to look. I have a useful application to try to show others what Apex can do for our customers to collaborate. However, most of our customers are using office 2007 so, hoping this is possible.
    I am using apex 3.2.0.00.27 if that helps someone to point me where to find more info on being able to have Word 2007 or excel 2007 fire up to open a .docx or .xlss file stored in a table blob column. Word or Excel does fire up to open .doc and .xls files.
    The following is the query for a report selecting the filenames uploaded into a blob column in my table:
    { SELECT s.ID, SUBSTR(s.NAME,INSTR(s.NAME, '/',1,1)+1,length(s.NAME)) SHORT_FNAME, s.SUBJECT
    FROM spp_attachments s
    WHERE s.PROGRAM_ID = :P2_PROGRAMID }
    Below is the stored procedure called from the link on the short_fname column in report query above.
    { create or replace PROCEDURE  download_file(p_file IN number) AS
    v_mime VARCHAR2(48);
    v_length NUMBER;
    v_file_name VARCHAR2(2000);
    Lob_loc BLOB;
    BEGIN
    APEX_APPLICATION.G_FLOW_ID :=245;
    IF NOT (wwv_flow_custom_auth_std.is_session_valid) then
    owa_util.status_line(404, 'Page Not Found',true);
    return;
    else
    SELECT MIME_TYPE, BLOB_CONTENT, name,DBMS_LOB.GETLENGTH(blob_content)
    INTO v_mime,lob_loc,v_file_name,v_length
    FROM spp_attachments
    WHERE id = p_file;
    -- set up HTTP header
    -- use an NVL around the mime type and
    -- if it is a null set it to application/octect
    -- application/octect may launch a download window from windows
    owa_util.mime_header( nvl(v_mime,'application/octet'),
    FALSE );
    -- set the size so the browser knows how much to download
    htp.p('Content-length: ' || v_length);
    -- the filename will be used by the browser if the users does a save as
    htp.p('Content-Disposition: attachment;
    filename="'||replace(REPLACE(substr(v_file_name,instr(v_file_name,'/')+1),chr(10),NULL),chr(13),NULL)|| '"');
    -- close the headers
    owa_util.http_header_close;
    -- download the BLOB
    wpg_docload.download_file( Lob_loc );
    end if;
    end download_file; }
    Thank you,
    Mark

  • How to specify the directory in which we want to store the uploaded files

    Hello !!
    I am using apache commonfile upload for uploading my files.I followed the user guide and tried to run a program,but my problem is I am not able to understand as to how to mention the directory in which the uploaded file will be saved..My code is given below :
    package r;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import org.apache.commons.fileupload.*;
    import org.apache.commons.fileupload.servlet.*;
    import org.apache.commons.fileupload.disk.*;
    import org.apache.commons.io.*;
    import java.lang.Exception;
    public class fileupload extends HttpServlet
         public void doGet(HttpServletRequest request,HttpServletResponse response)throws IOException,ServletException
                   // Check that we have a file upload request
                  boolean isMultipart = ServletFileUpload.isMultipartContent(request);
                 System.out.println(isMultipart);
                 if (ServletFileUpload.isMultipartContent(request))
                 // Create a factory for disk-based file items
                   FileItemFactory factory = new DiskFileItemFactory();
                   // Create a new file upload handler
                   ServletFileUpload upload = new ServletFileUpload(factory);
                   // Parse the request
                   try {
                               List items= upload.parseRequest(request);               
                             Iterator iter = items.iterator();
                             while (iter.hasNext())
                                   FileItem item = (FileItem) iter.next();                    
                                 if (item.isFormField()) //NORMAL FORM FIELD
                                 String name = item.getFieldName();
                                  String value = item.getString();
                                  System.out.println(value);                                                             
                                  else
                                 String fileName = item.getName();
                                 System.out.println(fileName);
                                    String contentType = item.getContentType();
                                  File saveTo = new File("/info/upload_files/myFile.jpeg");
                             try
                                       item.write(saveTo);
                                       System.out.println("File written" );                    
                             catch(Exception e)
                                         System.out.println("File not written");
                                   // InputStream fs= item.getInputStream();                    
                                   fileName = FilenameUtils.getName(fileName);
                                    System.out.println(fileName);
                        }//end of try
              catch (Exception e) { }
         public void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException
                 doGet(request,response);
    The problem is that the control doesn't reach the try statement and I get " File not written" on the console because it enters catch everytime..Please tell me how the path to the directory should be given...Rest of the code is working fine

    No, the problem is that when an Exception is thrown, you ignore it completely and throw away all the information associated with it. That leaves you to guess at what the problem is. So instead of answering your guess at a good question, I'm going to suggest that in all of your catch blocks you put this code:e.printStackTrace();Then you can look at the output in the log file and see what the problem is. Start from there.

  • Upload file input type="hidden" to server

    I have a file that is on a user machine. The file is always in the same location. I want to have the user click on an upload button without selecting a file and have it sent to the server for processing. I have tried to use <input type="hidden" name="fileupload" value="c:\filepath">. When I run it this way I get no file found. Please help!

    I am sorry, I will move it. Didn't notice it was in Acrobat, I was wanting Coldfusion.
    Edit: Since I am unaware of how to move it I'm just going to mark it as answered.

  • How to find file type (Binary/Ascii) using Java IO

    Hi
    I want to find whether the file is binary file or not.
    Can any one please help.
    Thanks,
    Joy

    Encephalopathic wrote:
    I'm no IO expert, but aren't all files binary?Yes.
    I think what the OP is after is how to tell if a file contains only characters (e.g. ASCII characters). This can be done by reading the file and checking if every byte is a valid ASCII character more or less. An example would be limiting byte values to 9 (tab), 10 (LF), 12 (FF), 13 (CR), and 32-127.

  • How to pass table type variable into function from SQL*PLUS ?

    How to pass a table type variable from sql*plus prompt into a function ?
    Thanx in advance.

    Krishna,
    Do you mean like this?SQL> DECLARE
      2      TYPE t_tbl IS TABLE OF VARCHAR2(20);
      3      l_sample_tbl           t_tbl;
      4
      5      FUNCTION print_contents ( p_tbl IN t_tbl )
      6      RETURN VARCHAR2
      7      IS
      8          l_string            VARCHAR2(1000);
      9      BEGIN
    10          FOR i IN 1..p_tbl.COUNT LOOP
    11              IF (i = 1) THEN
    12                  l_string := p_tbl(i);
    13              ELSE
    14                  l_string := l_string || ', ' || p_tbl(i);
    15              END IF;
    16          END LOOP;
    17          RETURN (l_string);
    18      END print_contents;
    19
    20  BEGIN
    21      l_sample_tbl := t_tbl();
    22      l_sample_tbl.EXTEND;
    23      l_sample_tbl(1) := 'one';
    24      l_sample_tbl.EXTEND;
    25      l_sample_tbl(2) := 'two';
    26      l_sample_tbl.EXTEND;
    27      l_sample_tbl(3) := 'three';
    28      l_sample_tbl.EXTEND;
    29      l_sample_tbl(4) := 'four';
    30      l_sample_tbl.EXTEND;
    31      l_sample_tbl(5) := 'five';
    32      DBMS_OUTPUT.PUT_LINE(print_contents(l_sample_tbl));
    33  END;
    34  /
    one, two, three, four, five
    PL/SQL procedure successfully completed.
    SQL> HTH,
    T.

  • How to store my mp3 files into my database

    Hello,
    I am having some trouble with a database i am creating to store my mp3 files. I have created the following sql statement so far using what research i did on the subject.
    CREATE TABLE music
    ( Artist CHAR(30),
    NameOfSong CHAR(30),
    Song BLOB);
    But i have no idea how to do a INSERT statement for the BLOB datatype. I am trying to use a location on my hard drive to upload the song to the table. All help is welcomed.
    Thank you,

    http://forums.oracle.com/forums/search.jspa?threadID=&q=insert+blob&objID=f75&dateRange=all&userID=&numResults=15
    Message was edited by:
    jeneesh

  • Request.getParameter() when uploading files

    Hi, I need to upload files and do other works .. such that, in my html ..
    <form name="composer" method="post" ENCTYPE="multipart/form-data">
    <input type=hidden name="a" value="a">
    <input type=File name=inputfile>
    <inpu type=button name=Upload onClick='upload file'>
    <inpu type=button name=otherStuff onClick='do other stuff'>
    </form>
    In the jsp for 'do other stuff', I have the following statement to get the value of a
    String a = request.getParameter("a");
    However, it returns 'null', if I erase the 'ENCTYPE' part from the html file, it works. How can I get it right?

    If your ENCTYPE is multi-part/form-data, then there is another technichque to read the form parameters.
    request.getParameter() won't work.
    first u need to read the requenct explicitely and divide the contents into parameters, files etc. and then read the parameter values.
    you can get a lot of stuff regarding this on web, like 'uploading files using jsp'.
    have fun!!

  • Change upload file name with com.oreilly.servlet.MultipartRequest to handle the file upload

    1. when use com.oreilly.servlet.MultipartRequest to handle the file upload, can I change the upload file name .
    2. how com.oreilly.servlet.MultipartReques handle file upload? do it change to byte ?
    what  different?  if I use the following method?
       File uploadedFile = (File) mp.getFile("filename");
                   FileOutputStream fos = new FileOutputStream(filename);
                    byte[] uploadedFileBuf = new byte[(int) uploadedFile.length()];
                   fos.write(data);
                 fos.close();

    My questions are
    1) when use oreilly package to do file upload , it looks like i line of code is enough to store the upload file in the
    file direction.
    MultipartRequest multi =
            new MultipartRequest(request, dirName, 10*1024*1024); // 10MB
    why some example still use FileOutputStream?
    outs = new FileOutputStream(UPLOADDIR+fileName); 
        filePart.writeTo(outs); 
       outs.flush(); 
      outs.close();
    2) can I rename the file name when I use oreilly package?

  • Remove link for uploaded files in application

    Hi all,
    I've been following the tutorial on how to upload and download files in application at http://download-uk.oracle.com/docs/cd/B32472_01/doc/appdev.300/b32469/up_dn_files.htm. I have now created my own table which stores the uploaded files and can download them successfully. I would now like to add the ability to delete these files within the application and was wondering what the best way of doing this was?
    I would like to add another column to the displayed report with a 'Remove file' link for each listed file, which when clicked would delete the file from the table. I've already tried using a similar method to the one used to upload the files (instead of uploading the file, the called procedure deletes it from the table using the specified ID), but this causes the application to display a blank page when the link is clicked, which I dont want (but does delete the file).
    I would appreciate any suggestions.
    Regards,
    Dave

    Dave,
    See the login page:
    http://htmldb.oracle.com/pls/otn/f?p=31517:101
    There are details on how to access the application builder, where you can see how the
    setup of that download, delete, upload application has been done.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Problem with: Upload file thru Web access.

    We have configure iFS 1.1 on AIX 4.3. Everything is running fine like ifsstart, ifsmgr. Its showing me all protocols and agents running.
    I am able to access iFS through web access program and its accepting login and password. After login in to iFS server when we try to upload any file using Brower option its gives us following error.
    Request URI:/ifslogin/jsps/upload2.jsp
    Exception:
    java.lang.NoClassDefFoundError: java/sql/Blob
         at oracle.jdbc.driver.OracleStatement.get_blob_value(Compiled Code)
         at oracle.jdbc.driver.OracleStatement.getBLOBValue(Compiled Code)
         at oracle.jdbc.driver.OracleStatement.getObjectValue(
    Can anybody guide us. We are not having JAVA knowledge.
    Thanks
    Dilip

    Hi,
    create an attribute(say ca_fileupload) of  type XSTRING  under context and bind that attribute with the data property.
    For binding the attribute just Click on the element file_up , there you can see data property,click on that and you can see all the nodes and attributes  you have created and there click on the attribute(ca_fileupload).

Maybe you are looking for

  • How to rebuild index on a table in a faster way

    Hi All, We have using Oracle 9.2.0.3 On weekly basis we are loading around 20-30 million of data into a table using sqlloader. Before loading the data into the table, we are dropping all the indexes adn rebuilding the same once done. There are 6 inde

  • File manager in wt13i

    which and how to download file manager in SE wt13i Solved! Go to Solution.

  • DG4ODBC MSSQL query works in sql, but won't compile in PL/SQL.

    I'm using DG4ODBC from 11g to query a SQL Server database. The query I'm using works in a SQL DEveloper SQL worksheet and sqlplus, but won't compile in a PL/SQL procedure. The query is   INSERT   INTO crm_labels       accountid,       label_name,    

  • Settings for Duplicate check ELM

    Hi We have to do duplicate check in ELM. I have done settings as per documentations given in IMG. But it is not working, giving error wrt BADI activation. Please tell me what all steps are required for doing duplicate check in ELM Thanks & Regards Hi

  • Error  in naming the variables

    Thanks SapUser1995 Edited by: SapUser1995 on Mar 30, 2011 9:42 PM