User Images: Storing in Files VS Storing in Database

  • Thread starter Thread starter Jonathan Wood
  • Start date Start date
J

Jonathan Wood

My site includes a feature that allows users to upload an image. (Never more
than one image per user.)

I've been considering storing these uploaded images as a file on the server
with a filename based on the user's ID key (a Guide).

But I'm wondering what some of the advantages and disadvantages are of this
approach over storing the images in the database. If it makes any
difference, the image will be shown on virtually every page.

One thing that I considered is that it will be possible to detect the user
ID of the displayed image from the filename, which could conceivable make it
slightly easier to come up with query argument hacks, although it's not very
likely to be successful. I'd be interested in any other considerations
people have considered.

Thanks.

Jonathan
 
Back
Top