Storing Images in SQL Server - ASP storage and retrieve

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Storing Images in SQL Server - ASP storage and retrieve

    I need some help, because I am utterly confused with how to do this. I have
    2 things that I need to figure out, and could use some sample code or just
    some general direction:

    1) I need to build an admin page that allows me to browse to the file that I
    want stored in SQL Server 2000 in an image field, have it uploaded to the
    server, and then stored in the db. I see this done all the time, so I don't
    think this part is too hard, but I'm not sure how to get the image into the
    db.

    2) I want to display the image within a web page, so I would want to pull
    the image out of the db, place it on my web server in a certain location,
    and then reference the file in the HTML. How do I do that?

    Thanks in advance for any help you can provide.

    --Mike


    Michael Walton Guest

  2. Similar Questions and Discussions

    1. XML Storing on Server
      Hi there! I'm new of this forum, and quite new of Flash scripting as well. I'm triyng to embed a "Flash-News-Editor" in my web site, and the idea...
    2. store/retrieve images to server
      Hi All, I want to retrieve images from server and send them back to Servlet without using FileUpload. It's an urgent requirement please help me out....
    3. unable to retrieve or display images from sql database
      Using Dreamweaver 8 and connecting to an Sql Server 2000 i am not able to display image files from the sql table. the other fields in the table are...
    4. Storing and displaying Images
      I am trying to find out which one of following two (2) options is fastest and most reliable in order to work with 100,000 images located in 100...
    5. Web Custom Control - Retrieve Images from a Multifile Assembly
      How do I store an image and a web custom control's dll in a multifile assembly so that the image can be retrieved and displayed while the control...
  3. #2

    Default Re: Storing Images in SQL Server - ASP storage and retrieve

    Why do you want to store the image in the database? This article really
    helped me decide which way to go on this, and I'm glad I didn't use the
    database for file storage after I've seen the headaches it's caused some of
    my colleagues.

    [url]http://www.aspfaq.com/show.asp?id=2149[/url]

    There are also links to knowledge base articles that show a few different
    methods, with code samples, if it's really what you want to do. But I
    highly recommend you reconsider.


    "Michael Walton" <mwalton@NOthomasassociatesSPAM.cc> wrote in message
    news:e4VZHevzDHA.1616@TK2MSFTNGP11.phx.gbl...
    > I need some help, because I am utterly confused with how to do this. I
    have
    > 2 things that I need to figure out, and could use some sample code or just
    > some general direction:
    >
    > 1) I need to build an admin page that allows me to browse to the file that
    I
    > want stored in SQL Server 2000 in an image field, have it uploaded to the
    > server, and then stored in the db. I see this done all the time, so I
    don't
    > think this part is too hard, but I'm not sure how to get the image into
    the
    > db.
    >
    > 2) I want to display the image within a web page, so I would want to pull
    > the image out of the db, place it on my web server in a certain location,
    > and then reference the file in the HTML. How do I do that?
    >
    > Thanks in advance for any help you can provide.
    >
    > --Mike
    >
    >

    Foo Man Chew Guest

  4. #3

    Default Re: Storing Images in SQL Server - ASP storage and retrieve

    I normally just store images on the directory structure, but I am having a
    real hard maintaining this in the environment that I am in. We have many,
    many authors and they keep moving images, deleting images, renaming images,
    and I end up with broken images, so I'd rather take care of it through the
    ASP code, so they can't screw it up. I will check the link, though.

    "Foo Man Chew" <foo@man.chew> wrote in message
    news:OTCn0hvzDHA.3216@TK2MSFTNGP11.phx.gbl...
    > Why do you want to store the image in the database? This article really
    > helped me decide which way to go on this, and I'm glad I didn't use the
    > database for file storage after I've seen the headaches it's caused some
    of
    > my colleagues.
    >
    > [url]http://www.aspfaq.com/show.asp?id=2149[/url]
    >
    > There are also links to knowledge base articles that show a few different
    > methods, with code samples, if it's really what you want to do. But I
    > highly recommend you reconsider.
    >
    >
    > "Michael Walton" <mwalton@NOthomasassociatesSPAM.cc> wrote in message
    > news:e4VZHevzDHA.1616@TK2MSFTNGP11.phx.gbl...
    > > I need some help, because I am utterly confused with how to do this. I
    > have
    > > 2 things that I need to figure out, and could use some sample code or
    just
    > > some general direction:
    > >
    > > 1) I need to build an admin page that allows me to browse to the file
    that
    > I
    > > want stored in SQL Server 2000 in an image field, have it uploaded to
    the
    > > server, and then stored in the db. I see this done all the time, so I
    > don't
    > > think this part is too hard, but I'm not sure how to get the image into
    > the
    > > db.
    > >
    > > 2) I want to display the image within a web page, so I would want to
    pull
    > > the image out of the db, place it on my web server in a certain
    location,
    > > and then reference the file in the HTML. How do I do that?
    > >
    > > Thanks in advance for any help you can provide.
    > >
    > > --Mike
    > >
    > >
    >
    >

    Michael Walton Guest

  5. #4

    Default Re: Storing Images in SQL Server - ASP storage and retrieve

    Simpler isn't always best, unfortunately. Like I told Foo Man Chew, I have
    control issues with the images being on the directory structure, so I need
    to look into db methods. Thanks for the opinion, though (and I agree with
    it).


    "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    news:uAOoGivzDHA.1500@TK2MSFTNGP12.phx.gbl...
    > 1) Actually it's not a good idea. Upload the image to the server and store
    > the Name/Location in the DB. look at [url]www.darkfalz.com/1043[/url] for a simple
    > upload script.
    >
    > 2) Much simplier if you have the image on the server.... :}
    >
    > --
    > Curt Christianson
    > Owner/Lead Developer, DF-Software
    > [url]www.Darkfalz.com[/url]
    >
    >
    > "Michael Walton" <mwalton@NOthomasassociatesSPAM.cc> wrote in message
    > news:e4VZHevzDHA.1616@TK2MSFTNGP11.phx.gbl...
    > > I need some help, because I am utterly confused with how to do this. I
    > have
    > > 2 things that I need to figure out, and could use some sample code or
    just
    > > some general direction:
    > >
    > > 1) I need to build an admin page that allows me to browse to the file
    that
    > I
    > > want stored in SQL Server 2000 in an image field, have it uploaded to
    the
    > > server, and then stored in the db. I see this done all the time, so I
    > don't
    > > think this part is too hard, but I'm not sure how to get the image into
    > the
    > > db.
    > >
    > > 2) I want to display the image within a web page, so I would want to
    pull
    > > the image out of the db, place it on my web server in a certain
    location,
    > > and then reference the file in the HTML. How do I do that?
    > >
    > > Thanks in advance for any help you can provide.
    > >
    > > --Mike
    > >
    > >
    >
    >

    Michael Walton Guest

  6. #5

    Default Re: Storing Images in SQL Server - ASP storage and retrieve

    1) Actually it's not a good idea. Upload the image to the server and store
    the Name/Location in the DB. look at [url]www.darkfalz.com/1043[/url] for a simple
    upload script.

    2) Much simplier if you have the image on the server.... :}

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    [url]www.Darkfalz.com[/url]


    "Michael Walton" <mwalton@NOthomasassociatesSPAM.cc> wrote in message
    news:e4VZHevzDHA.1616@TK2MSFTNGP11.phx.gbl...
    > I need some help, because I am utterly confused with how to do this. I
    have
    > 2 things that I need to figure out, and could use some sample code or just
    > some general direction:
    >
    > 1) I need to build an admin page that allows me to browse to the file that
    I
    > want stored in SQL Server 2000 in an image field, have it uploaded to the
    > server, and then stored in the db. I see this done all the time, so I
    don't
    > think this part is too hard, but I'm not sure how to get the image into
    the
    > db.
    >
    > 2) I want to display the image within a web page, so I would want to pull
    > the image out of the db, place it on my web server in a certain location,
    > and then reference the file in the HTML. How do I do that?
    >
    > Thanks in advance for any help you can provide.
    >
    > --Mike
    >
    >

    Curt_C [MVP] Guest

  7. #6

    Default Re: Storing Images in SQL Server - ASP storage and retrieve

    > 2) I want to display the image within a web page, so I would want to pull
    > the image out of the db, place it on my web server in a certain location,
    > and then reference the file in the HTML.
    Read that sentence a couple of times, and think about how efficient that is
    compared to <img src=/images/uploadedImage.jpg>


    Foo Man Chew Guest

  8. #7

    Default Re: Storing Images in SQL Server - ASP storage and retrieve

    Right - I totally understand. However, when that image isn't there, because
    dumb-idiot content developer has moved it or deleted it, how efficient is
    the empty image with the red x in it?? I totally understand what I am
    asking, and unless you have a better way to control the images on the
    server, I have to use the DB to do it. This will take the control away from
    the content developer and put it back into my hands. Trust me....the way
    you are telling to do it is the way I've done it for 10 years, but its not
    working in this environment, because of the morons I'm dealing with.

    --Mike

    "Foo Man Chew" <foo@man.chew> wrote in message
    news:exJUSkvzDHA.2308@TK2MSFTNGP11.phx.gbl...
    > > 2) I want to display the image within a web page, so I would want to
    pull
    > > the image out of the db, place it on my web server in a certain
    location,
    > > and then reference the file in the HTML.
    >
    > Read that sentence a couple of times, and think about how efficient that
    is
    > compared to <img src=/images/uploadedImage.jpg>
    >
    >

    Michael Walton Guest

  9. #8

    Default Re: Storing Images in SQL Server - ASP storage and retrieve

    Thanks, Foo. That link had some good information in it, as well as links
    with great examples. Exactly what I was looking for.

    I also appreciate the opinions that are out there....if I could do it that
    way, I would continue to do so, but until they start hiring intelligent
    people (or intelligent people start breeding), I'm stuck with this.

    --Mike

    "Foo Man Chew" <foo@man.chew> wrote in message
    news:OTCn0hvzDHA.3216@TK2MSFTNGP11.phx.gbl...
    > Why do you want to store the image in the database? This article really
    > helped me decide which way to go on this, and I'm glad I didn't use the
    > database for file storage after I've seen the headaches it's caused some
    of
    > my colleagues.
    >
    > [url]http://www.aspfaq.com/show.asp?id=2149[/url]
    >
    > There are also links to knowledge base articles that show a few different
    > methods, with code samples, if it's really what you want to do. But I
    > highly recommend you reconsider.
    >
    >
    > "Michael Walton" <mwalton@NOthomasassociatesSPAM.cc> wrote in message
    > news:e4VZHevzDHA.1616@TK2MSFTNGP11.phx.gbl...
    > > I need some help, because I am utterly confused with how to do this. I
    > have
    > > 2 things that I need to figure out, and could use some sample code or
    just
    > > some general direction:
    > >
    > > 1) I need to build an admin page that allows me to browse to the file
    that
    > I
    > > want stored in SQL Server 2000 in an image field, have it uploaded to
    the
    > > server, and then stored in the db. I see this done all the time, so I
    > don't
    > > think this part is too hard, but I'm not sure how to get the image into
    > the
    > > db.
    > >
    > > 2) I want to display the image within a web page, so I would want to
    pull
    > > the image out of the db, place it on my web server in a certain
    location,
    > > and then reference the file in the HTML. How do I do that?
    > >
    > > Thanks in advance for any help you can provide.
    > >
    > > --Mike
    > >
    > >
    >
    >

    Michael Walton Guest

  10. #9

    Default Re: Storing Images in SQL Server - ASP storage and retrieve

    So your content guy has his web server, and you have your DB server
    ... right? That's gotta suck ... can he create a virtual folder for
    the website ... a folder that is on your server?

    On Tue, 30 Dec 2003 12:20:18 -0500, "Michael Walton"
    <mwalton@NOthomasassociatesSPAM.cc> wrote:
    >Right - I totally understand. However, when that image isn't there, because
    >dumb-idiot content developer has moved it or deleted it, how efficient is
    >the empty image with the red x in it?? I totally understand what I am
    >asking, and unless you have a better way to control the images on the
    >server, I have to use the DB to do it. This will take the control away from
    >the content developer and put it back into my hands. Trust me....the way
    >you are telling to do it is the way I've done it for 10 years, but its not
    >working in this environment, because of the morons I'm dealing with.
    >
    >--Mike
    >
    >"Foo Man Chew" <foo@man.chew> wrote in message
    >news:exJUSkvzDHA.2308@TK2MSFTNGP11.phx.gbl...
    >> > 2) I want to display the image within a web page, so I would want to
    >pull
    >> > the image out of the db, place it on my web server in a certain
    >location,
    >> > and then reference the file in the HTML.
    >>
    >> Read that sentence a couple of times, and think about how efficient that
    >is
    >> compared to <img src=/images/uploadedImage.jpg>
    >>
    >>
    >
    >
    Brynn Guest

  11. #10

    Default Re: Storing Images in SQL Server - ASP storage and retrieve


    "Michael Walton" <mwalton@NOthomasassociatesSPAM.cc> wrote in message
    news:ehS9UlvzDHA.2604@TK2MSFTNGP09.phx.gbl...
    > Simpler isn't always best, unfortunately. Like I told Foo Man Chew, I
    have
    > control issues with the images being on the directory structure, so I need
    > to look into db methods. Thanks for the opinion, though (and I agree with
    > it).
    <snip>

    Why not solve your control issues, but storing the final images on the web
    server, where the authors cannot touch them? They can have their own working
    copy and submit the final to be included?

    BV.


    BenignVanilla Guest

  12. #11

    Default Re: Storing Images in SQL Server - ASP storage and retrieve

    I am also in the same boat, and i need to do this too any
    inputs will be huge, any luck anybody
    >-----Original Message-----
    >
    >"Michael Walton" <mwalton@NOthomasassociatesSPAM.cc>
    wrote in message
    >news:ehS9UlvzDHA.2604@TK2MSFTNGP09.phx.gbl...
    >> Simpler isn't always best, unfortunately. Like I told
    Foo Man Chew, I
    >have
    >> control issues with the images being on the directory
    structure, so I need
    >> to look into db methods. Thanks for the opinion,
    though (and I agree with
    >> it).
    ><snip>
    >
    >Why not solve your control issues, but storing the final
    images on the web
    >server, where the authors cannot touch them? They can
    have their own working
    >copy and submit the final to be included?
    >
    >BV.
    >
    >
    >.
    >
    Sanjeev Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139