2016-12-14 24 views

回答

1

不使用CI libaray.Lets嘗試...

$url = 'https://lh3.googleusercontent.com/-MzgndtILI5I/AAAAAAAAAAI/AAAAAAAAAAs/qB7MkGWroIY/photo.jpg'; 
/* Extract the filename */ 
$filename = substr($url, strrpos($url, '/') + 1); 
/* Save file wherever you want */ 
file_put_contents('upload/'.$filename, file_get_contents($url)); 

還採取從這裏參考... Saving image from PHP URLUploading image with url address in Codeigniter

相關問題