I have stumbled to following code example:
$image = \'file/path\';
$code = $tmhOAuth->request(\'POST\', \'https://upload.twitter.com/1/statuses/update_with_me
I don't know what library you're using, but I assume it uses the PHP cURL extension internally, because that's how you specify to cURL the path to a file that you want to upload, i.e., by prepending the path with an @
. See this example from the PHP manual:
'Foo', 'file' => '@/home/user/test.png');
curl_setopt($ch, CURLOPT_URL, 'http://localhost/upload.php');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_exec($ch);