Storing/Retrieving Files In Database

Discussion in 'ASP .Net' started by Cindy, Mar 8, 2008.

  1. Cindy

    Cindy Guest

    Hi. I'm using SQL Server 2005. I'd like to know if anyone has any
    reference on how to allow users to upload a file **onto a database**.
    In other words, a user can have several related files belonging to
    him. Also, I would need a syntax that allowed me to retrieve those
    files.

    I'm sure this is possible. Aside from that information, can anyone
    suggest whether this is the proper method? I know I can simply store
    the paths, but starting to juggle various directories is not really my
    cup of tea; if there is only one directory to store all the files,
    some of them might have the same name, thus creating a conflict. That
    is something I do not need to worry about if everything is stored in a
    table image field.

    In any case, thank you in advance for your help.

    Cindy
     
    Cindy, Mar 8, 2008
    #1
    1. Advertising

  2. On Mar 8, 5:31 am, Cindy <> wrote:
    > Hi.  I'm using SQL Server 2005.  I'd like to know if anyone has any
    > reference on how to allow users to upload a file **onto a database**.
    > In other words, a user can have several related files belonging to
    > him.  Also, I would need a syntax that allowed me to retrieve those
    > files.
    >
    > I'm sure this is possible.  Aside from that information, can anyone
    > suggest whether this is the proper method?  I know I can simply store
    > the paths, but starting to juggle various directories is not really my
    > cup of tea; if there is only one directory to store all the files,
    > some of them might have the same name, thus creating a conflict.  That
    > is something I do not need to worry about if everything is stored in a
    > table image field.
    >
    > In any case, thank you in advance for your help.
    >
    > Cindy


    http://www.google.com/search?hl=en&q=asp.net upload file into database
     
    Alexey Smirnov, Mar 8, 2008
    #2
    1. Advertising

  3. Cindy

    Cindy Guest

    On Mar 8, 9:20 am, Alexey Smirnov <> wrote:
    > On Mar 8, 5:31 am, Cindy <> wrote:
    >
    >
    >
    >
    >
    > > Hi.  I'm using SQL Server 2005.  I'd like to know if anyone has any
    > > reference on how to allow users to upload a file **onto a database**.
    > > In other words, a user can have several related files belonging to
    > > him.  Also, I would need a syntax that allowed me to retrieve those
    > > files.

    >
    > > I'm sure this is possible.  Aside from that information, can anyone
    > > suggest whether this is the proper method?  I know I can simply store
    > > the paths, but starting to juggle various directories is not really my
    > > cup of tea; if there is only one directory to store all the files,
    > > some of them might have the same name, thus creating a conflict.  That
    > > is something I do not need to worry about if everything is stored in a
    > > table image field.

    >
    > > In any case, thank you in advance for your help.

    >
    > > Cindy

    >
    > http://www.google.com/search?hl=en&q=asp.net upload file into database- Hide quoted text -
    >
    > - Show quoted text -


    Priviet Alexey --

    I am capable of searching Google; however, there are a couple of
    questions you left unanswered. Namely, is this the proper way of
    going about these things? Will the database bloat if there is too
    much information in it? Any considerations or suggestions would be
    helpful.

    Thanks.

    Cindy
     
    Cindy, Mar 8, 2008
    #3
  4. If you are asking whether file data should be stored in a database, that's
    really up to you. Many people store the files on the filesystem and only have
    a database entry that points to the file location. Regarding "bloat" that
    should not be an issue as long as the table(s) are properly indexed.

    -- Peter
    Site: http://www.eggheadcafe.com
    UnBlog: http://petesbloggerama.blogspot.com
    Short Urls & more: http://ittyurl.net


    "Cindy" wrote:

    > On Mar 8, 9:20 am, Alexey Smirnov <> wrote:
    > > On Mar 8, 5:31 am, Cindy <> wrote:
    > >
    > >
    > >
    > >
    > >
    > > > Hi. I'm using SQL Server 2005. I'd like to know if anyone has any
    > > > reference on how to allow users to upload a file **onto a database**.
    > > > In other words, a user can have several related files belonging to
    > > > him. Also, I would need a syntax that allowed me to retrieve those
    > > > files.

    > >
    > > > I'm sure this is possible. Aside from that information, can anyone
    > > > suggest whether this is the proper method? I know I can simply store
    > > > the paths, but starting to juggle various directories is not really my
    > > > cup of tea; if there is only one directory to store all the files,
    > > > some of them might have the same name, thus creating a conflict. That
    > > > is something I do not need to worry about if everything is stored in a
    > > > table image field.

    > >
    > > > In any case, thank you in advance for your help.

    > >
    > > > Cindy

    > >
    > > http://www.google.com/search?hl=en&q=asp.net upload file into database- Hide quoted text -
    > >
    > > - Show quoted text -

    >
    > Priviet Alexey --
    >
    > I am capable of searching Google; however, there are a couple of
    > questions you left unanswered. Namely, is this the proper way of
    > going about these things? Will the database bloat if there is too
    > much information in it? Any considerations or suggestions would be
    > helpful.
    >
    > Thanks.
    >
    > Cindy
    >
     
    Peter Bromberg [C# MVP], Mar 8, 2008
    #4
  5. On Mar 8, 8:51 pm, Peter Bromberg [C# MVP]
    <> wrote:
    > If you are asking whether file data should be stored in a database, that's
    > really up to you. Many people store the files on the filesystem and only have
    > a database entry that points to the file location. Regarding "bloat" that
    > should not be an issue as long as the table(s) are properly indexed.
    >
    > -- Peter
    > Site:http://www.eggheadcafe.com
    > UnBlog:http://petesbloggerama.blogspot.com
    > Short Urls & more:http://ittyurl.net
    >
    >
    >
    > "Cindy" wrote:
    > > On Mar 8, 9:20 am, Alexey Smirnov <> wrote:
    > > > On Mar 8, 5:31 am, Cindy <> wrote:

    >
    > > > > Hi.  I'm using SQL Server 2005.  I'd like to know if anyone has any
    > > > > reference on how to allow users to upload a file **onto a database**..
    > > > > In other words, a user can have several related files belonging to
    > > > > him.  Also, I would need a syntax that allowed me to retrieve those
    > > > > files.

    >
    > > > > I'm sure this is possible.  Aside from that information, can anyone
    > > > > suggest whether this is the proper method?  I know I can simply store
    > > > > the paths, but starting to juggle various directories is not really my
    > > > > cup of tea; if there is only one directory to store all the files,
    > > > > some of them might have the same name, thus creating a conflict.  That
    > > > > is something I do not need to worry about if everything is stored in a
    > > > > table image field.

    >
    > > > > In any case, thank you in advance for your help.

    >
    > > > > Cindy

    >
    > > >http://www.google.com/search?hl=en&q=asp.net upload file into database-Hide quoted text -

    >
    > > > - Show quoted text -

    >
    > > Priviet Alexey --

    >
    > > I am capable of searching Google; however, there are a couple of
    > > questions you left unanswered.  Namely, is this the proper way of
    > > going about these things?  Will the database bloat if there is too
    > > much information in it?  Any considerations or suggestions would be
    > > helpful.

    >
    > > Thanks.

    >
    > > Cindy- Hide quoted text -

    >
    > - Show quoted text -


    I agree with Peter.

    Sharepoint / WSS stores the files in SQL Server (can this be an answer
    to the question about proper way? :) I'm also working at the moment
    on a similar application that keeps files saved in the database. I
    decided to do this because of easy backup, synchronization and role-
    based security.
     
    Alexey Smirnov, Mar 10, 2008
    #5
    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:
    585
    blackg
    Mar 9, 2005
  2. Ryan Stewart

    Storing/retrieving BLOBs with JSPs

    Ryan Stewart, Dec 11, 2003, in forum: Java
    Replies:
    13
    Views:
    811
    bigbinc
    Jan 9, 2004
  3. Roy Gourgi
    Replies:
    1
    Views:
    286
    Victor Bazarov
    Jul 15, 2005
  4. toton
    Replies:
    11
    Views:
    742
    toton
    Oct 13, 2006
  5. Jonathan Wood
    Replies:
    1
    Views:
    531
    Jonathan Wood
    Jun 2, 2008
Loading...

Share This Page