Code to auto increment value to download images in a directory

Discussion in 'PHP' started by radio, Nov 12, 2007.

  1. #1
    We have been using a content management host who we will be moving away from. Their content management system has us upload images into a directory and then renames it a numerical value.

    Example:

    http://www.domain.com/directory/456548.jpg

    I have asked for our content in that directory to be burned to a cd or condensed to a zip file and emailed but they refuse, stating it's a service they don't offer. Clearly an attempt to make it more difficult to move to a new setup.

    At any rate, I would like a script that will go through the directory and download each image. I know the range of numbers for image file names, but there are gaps - I don't want the program to hang at those points.

    Example:
    http://www.domain.com/directory/456548.jpg
    http://www.domain.com/directory/456553.jpg
    http://www.domain.com/directory/456654.jpg
    http://www.domain.com/directory/457124.jpg

    Thanks!
     
    radio, Nov 12, 2007 IP
  2. iwyrobi

    iwyrobi Peon

    Messages:
    91
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    why not using ftp to download the whole image ?
     
    iwyrobi, Nov 12, 2007 IP
  3. radio

    radio Peon

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Great question - the reason is because we don't have FTP access to the directory. If I did, I'd use a client and do just that. Or am I missing something easy here?
     
    radio, Nov 12, 2007 IP