Get a Jumpstart with our Sample Apps
Results 1 to 3 of 3

Thread: Download only certain images from website.

  1. #1
    Member MikeData's Avatar
    Real Name
    Mike Data
    Join Date
    Nov 2008
    Posts
    899

    Default Download only certain images from website.

    The server have stored a bunch of images and I use this code to download them regularly:
    ==========
    vGet = ftp_get_list("www.mysite.com", "usrname", "pw1","/public_html/upload/uploaded/*.jpg", .T.)
    for each foo in vGet
    ftp_get_file("www.mysite.com", "usrname","pw1","/public_html/upload/uploaded/"+foo.value, "C:\MainFolder\Pict_upload"+chr(92)+foo.value)
    Next
    =============
    The above codes works well.
    The website contains 2 identical images, one is the normal submitted and one converted to 150x150.
    The second images beside the title, it has 150x150 at the end of the filename.
    ex: image 1 TheBridge.jpg image 2 TheBridge150x150.jpg
    So using above code, it downloads both of them.
    How can I download image 1 only, and leave the image with 150x150 in its file name untouched?
    At present I manage to get rid of the second, once downloaded. The problems is, it takes twice the amount of time.

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,662

    Default Re: Download only certain images from website.

    See if this gives you any ideas.

    Code:
    lst = " TheBridge.jpg"+crlf()+"TheBridge150x150.jpg"
    
    for each img in lst
    if "150x150" $ img.value
    msgbox("don't download this one")
    else
    msgbox("do download this one")
    end if
    next
    There can be only one.

  3. #3
    Member MikeData's Avatar
    Real Name
    Mike Data
    Join Date
    Nov 2008
    Posts
    899

    Default Re: Download only certain images from website.

    Stan thanks for the suggestion. The 150s are no longer coming down.
    Here is the new code :


    vGet = ftp_get_list("www.mysite.com", "usrname", "pw1","/public_html/upload/uploaded/*.jpg", .T.)

    for each foo in vGet
    if "150x150" $ foo.value
    ""
    else


    ftp_get_file("www.mysite.com", "usrname","pw1","/public_html/upload/uploaded/"+foo.value, "C:\MainFolder\Pict_upload"+chr(92)+foo.value)

    end if
    Next

    ===========
    Thanks again.

Similar Threads

  1. Download multiple files from website using http_download gives error
    By MikeData in forum Alpha Five Version 11 - Desktop Applications
    Replies: 11
    Last Post: 08-10-2014, 12:30 PM
  2. Internal Images ($$file) and HTML editor images not showing up
    By -Jinx- in forum Application Server Version 11 - Web/Browser Applications
    Replies: 21
    Last Post: 02-18-2014, 07:01 PM
  3. Alpha Website - swf images do not appear with iPad or iPhone
    By Mike Levesque in forum Application Server Version 10 - Web/Browser Applications
    Replies: 2
    Last Post: 12-07-2012, 06:00 PM
  4. Here is an Example, Google Maps, Images, GridLinker, Download
    By peteconway in forum Application Server Version 8
    Replies: 25
    Last Post: 05-25-2010, 11:22 AM
  5. uploading images and Changing images
    By valleyboy1303 in forum Application Server Version 8
    Replies: 0
    Last Post: 01-10-2008, 07:00 PM

Posting Permissions

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