Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > jakarta commons file upload and store to mysql

Reply
Thread Tools

jakarta commons file upload and store to mysql

 
 
Joshua
Guest
Posts: n/a
 
      10-20-2004
After a few hours digging around I found a few API's available to
provide file upload functionality. I decided to go with the jakarta
commons file upload classes. I can successfully upload a file,
storing it to disk on the server. I don't want to store a URL to
uploaded files in a table record, and so would rather store the file
itself in a record. I'm using MySql, and so assume I will use the
field type Blob.

Looking at the apache site [1] for customisation information there is
no documentation available. So looking at the available methods of
the FileItem class I can only assume I use the
FileItem.getInputStream() method to pull the contents of the file.

My question is, how do I transfer the contains of the file from the
returned java.io.InputStream into a blob mysql field, if blob is the
way forward of course.

I am using the com.mysql.jdbc.Driver JDBC driver downloaded from
mysql.com.

Any help much appreciated.

[1] http://jakarta.apache.org/commons/fi...stomizing.html
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Jakarta Commons HttpClient and a socket reset Joe Linux Java 0 09-15-2006 02:53 PM
Jakarta Commons FileUpload, error in file name extraction. i730lover Java 0 07-21-2006 03:52 PM
Jakarta Commons IO file filters elektrophyte Java 1 08-22-2005 12:05 AM
Jakarta Commons FileUpload and only *Partially* uploaded files Dundonald Java 2 03-23-2005 02:46 PM
Jakarta Commons FileUpload and only *Partially* uploaded files Dundonald Java 0 03-22-2005 03:21 PM



Advertisments