Capturing multiple pictures from database

Discussion in 'Programming' started by absentx, Mar 5, 2011.

  1. #1
    Okay so I am wondering if there is anyway to download multiple pictures from a websites database at once.

    I hope this is the best forum for my question...not sure though.

    So lets say I go to a website and I put in a part number in their "product look up section" and it directs me to a nice page specifically for that product and has the picture of that exact product.

    What If I wanted to download the picture for 200 some odd products? Clearly going through them one by one would be tedious and silly...Is there a way I could somehow download the picture for each product number simultaneously? I have no idea even where to start with this but I assume there has to be a way.

    Any help getting me pointed in the right direction or just some idea generation would be great.
     
    absentx, Mar 5, 2011 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Firstly, it is generally a really bad idea to store images in databases but if you insist on doing it....

    The norm would be to have a single SQL query that brings back the multiple records excluding the images themselves but including their unique identifier and img tag information which you use to then populate your HTML with the image tags src attribute being something like imagefile.php?ID=$imageID. Each ImageFile.php page then calls back the db to get the image itself and turn the blob into the image.

    Don't do PHP but assume it would be the same as .Net in that you can embed the data of the images directly in the pages themselves thus only having a single trip to the database however not all browsers support this... see http://en.wikipedia.org/wiki/Data_URI_scheme#Web_browser_support
     
    AstarothSolutions, Mar 6, 2011 IP
  3. ACME Squares

    ACME Squares Peon

    Messages:
    98
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Sounds like you want to write a bot that downloads images from a webserver.
    If the image name is related to the product code, or is the product code, you could just loop though and download them.
    If the image name is stored with the product code in the database, you'd have to scrape all the pages first, extract the image names, then download.

    Images are stored on the filesystem. Not in the database.
     
    ACME Squares, Mar 6, 2011 IP
  4. absentx

    absentx Peon

    Messages:
    98
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    AstarothSolutions

    I do not stored the pictures in the database...just the img tag information...sorry my language might have been confusing on the description.

    ACME

    Yes, I think that is what my solution would be...and correct, images not in database...but everyone seems to have got my point.

    Okay so writing a bot to do such things might be a tad above my head right now, but certainly something to look into.
     
    absentx, Mar 6, 2011 IP
  5. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #5
    I take it that you have no programming experience? It would be a fairly simple task, and for only 200 or so products it wouldn't take long to download them all with the help of a small piece of software. It would really only take a few minutes to code this for you. Another thing to consider is if you use these images then you may be breaking copyright laws...
     
    camjohnson95, Mar 6, 2011 IP
  6. absentx

    absentx Peon

    Messages:
    98
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Well I am actually going on two years now with PHP and I have quite a bit of confidence in what I can do with it, so perhaps writing this bot would not be that hard.

    I am authorized to deal the products I would be downloading for so I think getting permission to use the pictures would not be a problem.
     
    absentx, Mar 7, 2011 IP