struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wendy Cameron" <camer...@usq.edu.au>
Subject Files upload and inserting in database
Date Mon, 02 Dec 2002 04:26:51 GMT
I have a really simple question regarding, I understand that the database needs a file input
stream using the following as an example of putting a file in the database:

File file = new File("myimage.gif");
FileInputStream fis = new FileInputStream(file);
PreparedStatement ps = conn.prepareStatement("INSERT INTO images VALUES (?, ?)");
ps.setString(1, file.getName());
ps.setBinaryStream(2, fis, file.length());
ps.executeUpdate();
ps.close();
fis.close();

However I dont know what type the Bean object property should be in order to allow RequestUtils
to automatically  populate the bean property when multipart form content is used
thanks Wendy



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message