I need an external php script that does the following:
1. From a csv file gets the first value (the item number) and then connects to Magento database. It then pulls the image urls.
2. The script should then get the second value from the csv file and name the images according to that for each product.
3. Put the images in folders by Magento category names.
4. It should then write a zip file to download the images.
So for example, the first row of the file is: 150-05-0030B, 873265005536. It would find the product with the SKU of 150-05-0030B, then write the images as [url removed, login to view] in the folder images/magentocategory/873265005536.jpg. Additional images would be written as [url removed, login to view], [url removed, login to view], etc.
I need this right away within the next few hours if possible.