php - Get Image With file_get_contents it return Not Found Error -


i have 1 image on server (image).but when image file_get_contents() function return

not found error

and generate image.

file_put_contents(destination_path, file_get_contents(another_server_path)); 

plz me. if there way image.

try this.

there problem url special character.then have decode special character url basename.

$imgfile = 'http://www.lagrolla.com.au/image/m fr 137 group.jpg'; $destinationpath = '/path/to/folder/'; $filename = basename($imgpath); $imgpath = str_replace($filename,'',$imgpath).rawurldecode($filename); copy($imgfile,$destination_path.$filename); 

Comments