Return-Path: Delivered-To: apmail-jakarta-turbine-user-archive@apache.org Received: (qmail 18619 invoked from network); 6 May 2003 13:34:03 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 6 May 2003 13:34:03 -0000 Received: (qmail 4190 invoked by uid 97); 6 May 2003 13:36:06 -0000 Delivered-To: qmlist-jakarta-archive-turbine-user@nagoya.betaversion.org Received: (qmail 4183 invoked from network); 6 May 2003 13:36:06 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 6 May 2003 13:36:06 -0000 Received: (qmail 18255 invoked by uid 500); 6 May 2003 13:33:59 -0000 Mailing-List: contact turbine-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Turbine Users List" Reply-To: "Turbine Users List" Delivered-To: mailing list turbine-user@jakarta.apache.org Received: (qmail 18159 invoked from network); 6 May 2003 13:33:58 -0000 Received: from postoffice.tagaudit.com (HELO xeon400.tagaudit.com) (69.18.164.163) by daedalus.apache.org with SMTP; 6 May 2003 13:33:58 -0000 Received: by XEON400 with Internet Mail Service (5.5.2656.59) id ; Tue, 6 May 2003 09:29:21 -0400 Message-ID: <0C072E7CC947D511AC9600A0CC734120885EF2@XEON400> From: Lester Ward To: 'Turbine Users List' Subject: RE: Storing Images Date: Tue, 6 May 2003 09:29:20 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2656.59) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > This is not a question which is related to Turbine. > We need to store images for every record in a table.Currently > we were giving the images unique name and storing the name in > the Table column, wheras we were uploading the file in a > predefined folder. > Can someone on the list suggest a better solution, > something which is independent of the number of appservers. Store them in the database. Create a new table called "images" or something similar. It needs at least three fields: id, filename, data. The data should be a BLOB field. Remove the filename field from your existing table, replacing it with the an image_id field that references the new "images" table. You can serve the images several ways, including these: 1) When your application starts, walk the new images table and dump each image in it to the images directory on that server, overwriting any that are already there with the same names. This is somewhat costly at startup, but you will not have to change anything else in the system; images will continue to work as they have been. or 2) Create a new servlet and set it up to be called when someone requests and image file (or, if possible, just image URLs that have a pattern that indicates they are part of this table). Have this servlet read the image stream from the database and return it directly. or 3) Some other method. I'd recommend method 1, has generally startup time on a web application is of no major importance and it allows web caching to work as normal. Note that both of these systems can be modified slightly to support images in multiple languages (or even just branding or skins). If you are going through the trouble of changing the imaging system, you might want to consider if such features would be worth building in. --------------------------------------------------------------------- To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: turbine-user-help@jakarta.apache.org