J
Joshua
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/fileupload/customizing.html
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/fileupload/customizing.html