Download image and store it locally

I am importing an inventory file from a vendor. The vendor has images for their products on their site.

In my import process, I would rather download each image and store it locally and then use the link to the locally stored image than using the link to the image on the vendor’s site in my code.

How would I do that?

copy() works with urls, and is probably the easiest way.

Perfect, I just tested it on my server and it works great.