如何将不带 url 形式的文件上传到我在 codeigniter 中的目录?

How to upload file without form some url to my directory in codeigniter?

我在我的网站上设置了 google 登录,google 给我一些 url 像 所以我没有表格然后我如何上传这个 url 图片到我的目录?

我没有从任何站点获得有关此问题的资源。

不使用 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 URL and Uploading image with url address in Codeigniter