I have written a huge stored proc to import a vendor's import data into our e-commerce shop.
I am stuck on getting the images from the vendor's site.
Is this a possibility within the stored proc?
The image link is a url and in PHP, I do it like this. How can I do something like this in my stored proc?
// $image contains the link to the image on the vendor's server
$path_parts = pathinfo($image);
$ext = $path_parts['extension'];
$newname = '../img/p/'.$partno.'.'.$ext;
if (!file_exists($newname)) {
if(@copy($image,$newname))
{
// Now create the new link and set $image variable to it.
$image = $partno.'.'.$ext;
} else {
// $image is already set to the URL of the image
} // if(@copy($image, $newname))
} else {
$image = $partno.'.'.$ext;
}
// $image is inserted into the table in the column for the
// locally stored image