i'm trying to get an image from a URL and then save it to an images folder on my server. my site is hosted on bluehost and i'm using the following php script...
$url = "http://www.google.com/images/srpr/logo4w.png";
$save_name = "logo4w.png";
$save_directory = "/albums/images/art/";
if(is_writable($save_directory)) {
file_write_contents($save_directory . $save_name, file_get_contents($url));
} else {
exit("Failed to write to directory ".$save_directory);
}
but every time i try this i get the "Failed to write to directory error". I don't really know what i'm doing wrong. i could really use some help.