我想使用file_put_contents
从URL(Facebook和Twitter)下载和创建多种类型(不同大小)的图像。使用file_put_contents下载图像
我的剧本是这样的:
$image = $user->getAvatarSocial();
//image like: => https://abs.twimg.com/sticky/default_profile_images/default_profile_4.png
file_put_contents($image, file_get_contents('php://input'));
但我收到此错误:
Warning: fopen(http://abs.twimg.com/sticky/default_profile_images/default_profile_4.png): failed to open stream: HTTP wrapper does not support writeable connections
我使用的Symfony 2.3.7。
[未能打开流:HTTP包装不支持可写连接]的可能重复(http://stackoverflow.com/questions/9748076/failed-to-open-stream-http-wrapper-does-not-support可写连接) – Thibault
@Thibault图像不在我的服务器 – Twinsen