VFP 9 Download Images Via URL

Hello Experts.

I have a few thousand product images I need to download. Each is referenced by a url in the format: hxxp://foo.bar/product_number.jpg

The site however contains tens of thousands of images. I need a fraction of them.
Instead of downloading each individually, which would take me weeks, I was wondering if I could accomplish this with fp.
The individual filenames (product numbers appended with .jpg) are already contained in a vfp table.

Can I scan or loop through this table and have vfp retrieve each image for me, and if so, how?
Thx!
formadmirerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pcelbaCommented:
If you are able to access the web via FTP then you may loop through your table and generate a script to download all pictures by some FTP client (e.g. FTP.EXE in DOS mode).

You could also use some freeware, e.g.
http://www.chami.com/tips/windows/062598W.html
http://www.vicman.net/getfree/WebGrab_38662s.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
formadmirerAuthor Commented:
Thanks for the replies.

I may be missing something, but each method above appears to rely on me manually entering each image url to be downloaded.

What I really need is a way to use the already existing images names in the table to initiate the downloads.

I can have vfp access a website url using DECLARE INTEGER ShellExecute/FindWindow, what I need is a way after accessing the url to have fp download the image that resides at the url.

0
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

formadmirerAuthor Commented:
JFO -

I just looked over what you suggested again and on second look it looks like this is exactly what I need.

I haven't tested anything yet, but just wanted to say thanks in advance.
0
formadmirerAuthor Commented:
I created a .prg but when I compile I get:

Program c:\stuff\download_images.prg has the following errors:
    Unknown HTTPGET - Undefined

I included the line
SET LIBRARY TO (LOCFILE("vfpconnection.fll","FLL"))
and the vfpconnection.fll file does exist in a subdirectory of the program.

What am I missing/doing wrong??

0
CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
DECLARE LONG URLDownloadToFile IN URLMON.DLL LONG, STRING, STRING, LONG, LONG
nResult = URLDownloadToFile(0, cURL, cFileName, 0, 0)
0
CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
What you can also also is this:

1) Download Free Download Manager
2) Create a text file out of the table
3) Import the text file into Free Download Manager
4) Program what to download and when to download where to download it and at which bandwidth
0
formadmirerAuthor Commented:
Finally got it sorted out and it worked absolutely beautifully. Thank you!

CaptainCyril - I'm not sure what DECLARE LONG... does as I've never used it before, but the .prg wound up working without it.

As for your second suggestion, that is what I was looking for in the beginning and sounds ideal.

I'll run it both ways with a limited data set and see which works best. Thanks for the suggestion.

0
CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
DECLARE registers an API Function in Windows so you can call it from VFP.
0
CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
DECLARE LONG URLDownloadToFile IN URLMON.DLL LONG, STRING, STRING, LONG, LONG
cURL = "http://www.mywebsite.com/mypicture.jpg"
cFileName = "c:\pics\mypicture.jpg"
nResult = URLDownloadToFile(0, cURL, cFileName, 0, 0)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
FoxPro

From novice to tech pro — start learning today.