Using the block of code below, which I am faily positive is correct, I save images from the $img variable at about 1/7th the image.
Could anyone tell me why the entire files aren't being read/saved?
Thanks!
$img = "http : // [url]www.website[/url] . com / thatonefile.jpg";
$handle = fopen($img, "r") or die('Could not eastablish remote connection.');
$file = fread($handle, 5000000) or die('Could not get file contents.');
chmod($site_dir."/images/", 0755) or die('Could not CHMOD the directory images.');
$new_handle = fopen($site_dir."/images/".$image, "w") or die('Could not establish local connection.');
$write = fwrite($new_handle, $file) or die('Could not write contents to the file.');