2 Replies Latest reply on Aug 11, 2004 12:38 PM by raist_majere

    best approach

    spyer

      Hi

      Could anyone suggest the best approach to upload large documents\files from a client to an database via jboss.

      Client could be web\GUI
      Using JBoss 3.2.3
      Oracle 9i
      upload file size no limit.

      we currently have a file size constraint 8k on files stored in the database, as we hit memory problems with larger files.

        • 1. 3852320
          raist_majere

          Hi Ben

          Thanks for that - yes, that'll do nicely!

          Incidently,just one more question - Bela said some time back that the cache code would be refactored and one of the new features would be the ability to use other transports over jgroups. Is this still the case?

          Thanks
          Nick

          • 2. Re: best approach

            Spyer;

            We used the following process to upload files up to 2 or 3 MB into Oracle Blobs:

            1. Http File Upload From Client with posted meta-data fields.
            2. Read Input Stream from file upload and bind it to a JDBC BLOB type.
            3. Read in the meta-data and bind to applicable JDBC bind variables.
            4. Execute insert to the database.

            In our case, we used:
            Browser --> Servlet --> Session Bean --> CMP2 Entity Bean

            but in general, you have a lot of options. The CMP part was tricky, but if you choose to use hand coded JDBC, there are loads of Oracle examples on handling BLOBs.

            From a rich client (Java ?) it is probably simpler. Just read the file into a byte array and send it to the server over whatever transport you choose and do the same thing from there.

            //Nicholas