By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,712 Members | 1,591 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,712 IT Pros & Developers. It's quick & easy.

User Images: Storing in Files VS Storing in Database

P: n/a
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

Jun 2 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Performance is better if you store the image as a file. If you want the
filenames to be unguessable then you could add some random characters to the
filename.

"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
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


Jun 2 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.