add_pic_t
腾讯QQ互联接口:add_pic_t 该如何发送图片到微博
$url = xxxxxxxxxxxxx;//url$img_name = basename($url);$img_type = getimagesize($url);'pic' => array( 'type' => $img_type['mime'], 'name' => $img_name, 'data' => file_get_contents($url), )
二进制流形式是腾讯sdk自己写好的这个不用管 只要配置好后正确传入参数即可.
$img_url = 'http://www.xxx.com/1.jpg';//$img_url = 'D:\\1.jpg';也不行$img_name = basename($img_url);$img_type = getimagesize($img_url);$ary_t = array( 'content' => $content, 'clientip' => '180.109.98.52', 'pic' => array( 'type' => $img_type['mime'], 'name' => $img_name, 'data' => file_get_contents($img_url), ), ); $rt_info_t = $qc->add_pic_t($ary_t);
返回什么错误 代码多少?
没有返回任何错误,发布成功了。但是图片没有发上去。
这个问题我已经解决了。多谢你。
正确写法应该是:
$img_filename = 'D\\abc\1.jpg';$ary_t = array( 'content' => $content, 'clientip' => $_SERVER['REMOTE_ADDR'], 'pic' => '@'.$img_filename, ); $rt_info_t = $qc->add_pic_t($ary_t);
正确写法应该是:
$img_filename = 'D\\abc\1.jpg';$ary_t = array( 'content' => $content, 'clientip' => $_SERVER['REMOTE_ADDR'], 'pic' => '@'.$img_filename, ); $rt_info_t = $qc->add_pic_t($ary_t);
正确写法应该是:
$img_filename = 'D\\abc\1.jpg';$ary_t = array( 'content' => $content, 'clientip' => $_SERVER['REMOTE_ADDR'], 'pic' => '@'.$img_filename, ); $rt_info_t = $qc->add_pic_t($ary_t);
正确写法应该是:
$img_filename = 'D\\abc\1.jpg';$ary_t = array( 'content' => $content, 'clientip' => $_SERVER['REMOTE_ADDR'], 'pic' => '@'.$img_filename, ); $rt_info_t = $qc->add_pic_t($ary_t);
正确写法应该是:
$img_filename = 'D\\abc\1.jpg';$ary_t = array( 'content' => $content, 'clientip' => $_SERVER['REMOTE_ADDR'], 'pic' => '@'.$img_filename, ); $rt_info_t = $qc->add_pic_t($ary_t);
请问一下楼主后面是怎么解决的呀,我也碰到这个问题了