我想使用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