• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: images in databases
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: images in databases


  • Subject: Re: images in databases
  • From: Thomas Pelaia <email@hidden>
  • Date: Fri, 25 Feb 2005 15:35:27 -0500

I think storing images and attachments in a database works very well.

We store text, images and attachments in our database and it works great. We do not see any serious performance hit for our application. Yes, you have to be careful to manage the MIME type, but Java has methods for handling this. Namely use URLConnection.getFileNameMap().getContentTypeFor() to get the MIME type for an image or attachment file. In our application, users load images and attachments from their file system. I use the method to get the MIME type and store the image and mime type in the database record. If you allow people to download your images or attachments directly, you will want to provide your own image component for this regardless of whether the image is from a database or a file. With a custom handler the (which you write just once) you can have the image download with the proper MIME type and filename. This works for all modern browsers that support HTTP 1.1 (Safari, Firefox and yes even I.E.). Also, my custom image component uses the new streaming capability of WebObjects to stream images to the users.

We have not had any bad experience storing and delivering images from our database and it surely is convenient to do so. Our images and attachments are typically on the order of 100K in size but some even get into a few megabytes in size. We use WebObjects 5.2.3 as a true WAR servlet under JBoss for our application and Oracle 9i for our database.

-tom


Bill I disagree with you on that one. The only reason for not storing
the images in the db is because WO does not support it very well. There
are a number of way you can improve WO to make it behave and I have
done it successfully, if only Apple could listen and fix it for
everyone we would not have that discussion every few months. On the
other side having the images outside of the database essentially
destroy the initial reason for having a database. The drawback of
having operational information on two different repositories (db and
file system) are not negligible in particular backup, security and
synchronization issues.

Pierre

On Feb 24, 2005, at 13:16, email@hidden wrote:

On Feb 24, 2005, at 1:07 PM, Jeremy Matthews wrote:
Any arguments pro/con storing images inside a database vs.
referencing them inside some protected folder in a webserver itself?

Images not as in a wrapper...think inventory and such.

Yes. Don't do it. The cons vastly outweigh the pros and, from a security perspective, you are pretty much toast anyway if someone cracks your webserver.

A much longer response from the archives:

    http://www.wodeveloper.com/omniLists/webobjects/1999/msg03936.html


_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: images in databases
      • From: PA <email@hidden>
  • Prev by Date: Re: images in databases
  • Next by Date: Re: images in databases
  • Previous by thread: Re: images in databases
  • Next by thread: Re: images in databases
  • Index(es):
    • Date
    • Thread