OK,... this is in reference to: Copy Image from Remote Server Over HTTP
Here is my code:
for ($i = 0; $i < count($json_post['Category']); ++$i )
{
echo $json_post['Category'][$i]['CategoryID'] . '<br />';
echo $json_post['Category'][$i]['Name'] . '<br />';
echo $json_post['Category'][$i]['Image'] . '<br />';
$image_URL = "https://$_SSActiveWear_BaseURL/" . $json_post['Category'][$i]['Image'];
echo $image_URL . "<br /><br />";
copy("https://$_SSActiveWear_BaseURL/$image_URL", $_SERVER['DOCUMENT_ROOT']."/tmp/" . basename($image_URL));
die;
}
I have tried cURL with the same results.
What is happening is that the files are being created, but with all the same file length of 58k and when I attempt to open one to view it, it is unable to be opened. In fact its the HTML content of the index page from the server I am attempting to save the image from.
Edit 1 If I hard code the image to be saved instead of using the variables, it saves the correct image.