if(substr($image,0,7)=='http://'||substr($image,0,8)=='https://'){
$parts = explode('/',$image);
$name = array_pop($parts);
$name = explode('?',$name);
$name = array_shift($name);
$name = urldecode($name);
if(!file_exists($this->uploadFolder.$name)){
$content = file_get_contents($image);
JFile::write($this->uploadFolder.$name,$content);
}else{
$size = $this->getSizeFile($image);
if($size!=filesize($this->uploadFolder.$name)){
$name=$size.'_'.$name;
if(!file_exists($this->uploadFolder.$name)){
$content = file_get_contents($image);
JFile::write($this->uploadFolder.$name,$content);
}
}
}
if(file_exists($this->uploadFolder.$name) && (filesize($this->uploadFolder.$name) > 0 || filesize($this->uploadFolder.$name) === false)){
$product->images[$k] = $name;
}else{
$unset[]=$k;
}
}