469,616 Members | 1,792 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,616 developers. It's quick & easy.

User Images: Storing in Files VS Storing in Database

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
1 1508
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.

Similar topics

7 posts views Thread by Benoit St-Jean | last post: by
6 posts views Thread by bissatch | last post: by
4 posts views Thread by IkBenHet | last post: by
9 posts views Thread by Adam J Knight | last post: by
10 posts views Thread by Matt Fielder | last post: by
reply views Thread by Jonathan Wood | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.