> -----Original Message----- > From: Jim Barrows > Sent: Friday, August 20, 2004 1:14 PM > To: Struts Users Mailing List > Subject: RE: Uploading files to a database > > > > > > -----Original Message----- > > From: Ivan Vasquez [mailto:[EMAIL PROTECTED] > > Sent: Friday, August 20, 2004 1:04 PM > > To: [EMAIL PROTECTED] > > Subject: Uploading files to a database > > > > > > Hi, > > > > What's the preferred way to upload files into a database in > a J2EE Web > > application?
Jakarta file-upload http://jakarta.apache.org/commons/fileupload/ > > > > Is there any way to stream the file straight from the > > HttpServletRequest > > to the database without staging it in the server's filesystem? \ Answered the second quesiton, not the first... > > Since you have to have the entire file before saving it into > the DB, you either store the entire file in memory, or put it > on the filesystem. > I suppose you could, store the current buffer contents... > read the next buffer full, re-get the field, append the new > buffer to what's in the database, then update it. course, > the only that does is beat the snot out of your database and > the GC, since you still have to have enough memory to store > the whole file in memory, plus bring it across the network > (filesize/buffersize)*2 times. The GC of course would have > to run a lot as well, since you'd be dynamically allocating > 2(filesize/buffersize) buffers. Your network traffic would > be something like 2(filesize/buffersize)buffersize. > So.... ummmm unless your db has that option, and a JDBC > connector that allowed it... no. > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]