Followed this to create a php app to post a tweet that includes image.
> $tmsg = 'My Tweet Message';
> $timg = 'https://< path to image file >';
> $tweet = $twitter->send($tmsg,$timg);
> public function send($message, $media = NULL)
> {
> $mediaIds = array();
> foreach ((array) $media as $item) {
> $res = $this->request(
> 'https://upload.twitter.com/1.1/media/upload.json',
> 'POST',
> NULL,
> array('media' => $item)
> );
> $mediaIds[] = $res->media_id_string;
> }
> return $this->request(
> 'statuses/update',
> 'POST',
> array('status' => $message, 'media_ids' => $mediaIds ? implode(',', $mediaIds) : NULL)
> );
> }
I get following error:
Error: Cannot read the file https://< path to image file >. Check if file exists on disk and check its permissions.
I have confirmed the image file exists and has all read/write (777) permission.
Any idea what may be the issue?
Thanks