Page 1 of 1

ftp files down that match a list in a SQL table?

Posted: Mon Feb 02, 2004 5:02 pm
by Bsnrjones
I was hoping that someone has either already written something like this or can at least give me a concept of how I should go about it.

I have a list of SKU's in a database for products. I want to take that list of skus and ftp image files from another server that match those skus.

The images are named by the sku of the product.

So somehow I need to read the list of sku's from the sql database and then put them into an array - I think. Then read out of this array for the file names to ftp to my local server.

Any clues?

Burke

Posted: Tue Feb 03, 2004 1:08 am
by teniosoft
Here is what you could do.

You kind of have the files in an array already the recordset.

Now what you can do is place all of the files in an http directory.

Next use wget to download the images.

You can probally also do this with ftp some how but, I think you have the basic idea


select img_nm from prod_table
while rs is not empty
{
wget the file and save it to the location that you would like it to be at
make sure permission are set correctly
}

Posted: Tue Feb 03, 2004 7:59 am
by Bsnrjones
Thanks! That gets me going on the right track. I will let you know how it goes.