I needed to upload 400 products in an WooCommerce webshop. I have bought and installed a WooCommerce plugin to import products by uploading a CSV-file with all the nessesery information about the products.

But this time the client offered an XML file format with all the data. Including external links to the images of the products. As I don’t want to link from this webshop to an external site for showing the images I needed to download the images. But with 400 products and each product contains 2 to 5 images this would be a huge work if I should download the images manually.

The XML file looked like this but then with 400+ products:

URL in address bar

I could used one of the many XML to CSV converters that are available online, and then do some little programming or scripting to download the images. But hey, we’re programmers aren’t we?? So I decided to write my own tool that converts XML to CSV and build in an option to download images from the links provided in the XML. I found a neat NuGet package called ChoETL that offers a parser for the convertion. Normally I try to code stuff myself to learn, but for this little project I was a little bit short on time. All I had to do is added some little code (Regex FTW!) to find, download and zip the images.

Why all this work? Because I know that within the next year or so I’ll get a new XML file with new or updated products. So the time invested in creating my own tool would save me some time in the future.

You can find the tool here.

Feel free to (ab)use and/or share this tool. If you have any problems or suggestions, then ping me at Twitter, and I’ll see what I can do for you.

When I have some spare time I'll update this tool so that it can download any type of file, like PDF's. For now this tool can only download images.