User Images: Storing in Files VS Storing in Database

Discussion in 'ASP .Net' started by Jonathan Wood, Jun 2, 2008.

  1. 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
     
    Jonathan Wood, Jun 2, 2008
    #1
    1. Advertising

  2. Thanks. Performance is an important consideration for me.

    --
    Jonathan Wood
    SoftCircuits Programming
    http://www.softcircuits.com

    "Aidy" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:%...
    >> 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
    >>
    >>

    >
    >
     
    Jonathan Wood, Jun 2, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. blackg
    Replies:
    2
    Views:
    579
    blackg
    Mar 9, 2005
  2. Adam J Knight

    Storing Images?

    Adam J Knight, Feb 2, 2006, in forum: ASP .Net
    Replies:
    8
    Views:
    524
    RedHair
    Feb 5, 2006
  3. toton
    Replies:
    11
    Views:
    721
    toton
    Oct 13, 2006
  4. Cindy
    Replies:
    4
    Views:
    385
    Alexey Smirnov
    Mar 10, 2008
  5. SRM
    Replies:
    1
    Views:
    509
    Göran Andersson
    Jan 9, 2009
Loading...

Share This Page