php twitter帖子图像无法正常工作

php twitter帖子图像无法正常工作,php,twitter,Php,Twitter,我正试图在Twitter上发送带有图像的状态信息。状态已成功发布,但图像未显示。为什么会这样 我的代码有错误吗?状态更新成功 require_once 'twitteroauth.php'; $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_TOKEN, OAUTH_SECRET); $content = $connection->get('account/verify_credentials');

我正试图在Twitter上发送带有图像的状态信息。状态已成功发布,但图像未显示。为什么会这样

我的代码有错误吗?状态更新成功

require_once 'twitteroauth.php';


$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_TOKEN, OAUTH_SECRET);
$content = $connection->get('account/verify_credentials');
$image = 'logo.png';
$connection->post('statuses/update', 
    array(
        'media[]'  => "@{$image};type=image/jpeg;filename={$image}",
        'status'   => 'message text written here',
    ),
    true, // use auth
    true  // multipart
); 

您确定image logo.png的路径正确吗?是路径正确#BonoJust注意到您指定的type=image/jpeg,而您的徽标是png。试着改变一下?这也可能对您有所帮助:更新但仍然不工作我的图像在这里:$image='';和twitter墙:可以肯定的是,您使用的是本地文件系统中的图像,对吗?我不确定twitter是否能从网站上阅读到它。