I have made this code, to save images to a remote directory, but i have not an Idea where to code do nothing if file exists:
$album_name = $row['album'];
if(file_exists("cdcovers/$album_name.jpg")){
<---here
}
else {
//save images
$imageString = file_get_contents(LastFMArtwork::getArtwork($row['artist'], $row['album'], true, "large"));
$save = file_put_contents('/home/link/public_html /cdcovers /'.$row['album'].'.jpg',$imageString);
}
Can i have some ideas?