Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/259.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP上传fb用户';s图像不是';不可见?_Php_Facebook - Fatal编程技术网

PHP上传fb用户';s图像不是';不可见?

PHP上传fb用户';s图像不是';不可见?,php,facebook,Php,Facebook,我正在我的网站上进行FB登录,除了一个奇怪的问题外,我都做了。 我遵循这一点,除了上传的图像是空的以外,它工作正常 什么会导致图像损坏,或者如何解决此问题?当我在我的桌面上下载上传的图片时,它只是说我们无法打开此文件 $image = file_get_contents('https://graph.facebook.com/'.$fid.'/picture?type=large'); $dir = dirname(__file__).'/avatar/'.$fid.'.jpg'; file_p

我正在我的网站上进行FB登录,除了一个奇怪的问题外,我都做了。 我遵循这一点,除了上传的图像是空的以外,它工作正常

什么会导致图像损坏,或者如何解决此问题?当我在我的桌面上下载上传的图片时,它只是说
我们无法打开此文件

$image = file_get_contents('https://graph.facebook.com/'.$fid.'/picture?type=large');
$dir = dirname(__file__).'/avatar/'.$fid.'.jpg';
file_put_contents($dir, $image);

尝试使用curl发出请求。由于graph url获取重定向文件,所以获取内容函数不遵循重定向。我尝试了,但仍然不起作用。当使用符号curl或
https://scontent.xx.fbcdn.net/v/t1.0-1/
它甚至没有上传图像文件。好的,这对我来说很有效。谢谢