Save Images On Server

I have an affiliate website which gets all products every day by a cron job. It is now showing the images from the seller. I want to save the images on my server to speed up my website.

I need a script which runs after the regular cronjob.
This script should read the image and save it to my server.
After this is should replace the link in the database to the local link.
If the image is already on the server it should skip and go to the next image.

It should create a directory for each seller (and future sellers) if it is not yet created before.

Leave a Reply

Your email address will not be published. Required fields are marked *