1 Reply Latest reply on Jan 27, 2003 12:38 AM by Xavier Cho

    Uploading/Download files using JBoss and MySQL

    Tim Bauer Novice

      If anyone out there is having problems uploading files (text,richtext, ms word, ms excel, PDF, etc) to MySQL using JBoss CMP entity beans...then contact me at tbauer@mac.com and I can share with you how I got it to work...really simple actually.

      I have built a function that allows people to upload certain types of files to their "User Profile", then have their agencies download the files if needed.

      The problem I faced, was how to MATCH the bean and model definitions to correctly upload/dowload the byte[] array that is streamed in from the http request....

      Finally got it to work after about three days of futzing around and scouring google for advice...

      cheers,

      Tim

        • 1. Re: Uploading/Download files using JBoss and MySQL
          Xavier Cho Newbie

          How did you workaround the OutOfMemoryError problem when you download/upload big files through CMP bean? I've just implemented similar application but had to use direct JDBC to retrieve binary stream, since I couldn't find any other method to get BLOB data in stream format using CMP bean.

          BTW, I've put oscache filter in front of the download servlet which helps to reduce database hit so reading BLOB column in database does not occur everytime users send download request.

          If you have found any useful tips/workarounds regarding EJB download/upload component implementation, I'd very appreciate your comment.

          Thanks

          Xavier