[http_code] => 403 ,I am not able to upload image with comment


#1

Consumer key : zqSQSuoyOHI6jgQ0xiStXQ
I am not able to post image with comment to Twitter.
I am using
$code_with_image = $tmhOAuth->request( ‘POST’, ‘https://upload.twitter.com/1/statuses/update_with_media.json’, array( ‘media[]’ => “@{$image};type=image/jpeg;filename={$image}”, ‘status’ => ‘Picture time’, );
this code, with OAuth but still can’t post image with comment.
Although I am able to post comment to twitter with the help of
$code = $tmhOAuth->request( ‘POST’, ‘https://api.twitter.com/1/statuses/update.json’, array( ‘status’ => ‘Picture time’, );
this code.
when I print $code_with_image it prints

TwitterOAuth Object ( [http_code] => 403 [url] => https://upload.twitter.com/1/statuses/update_with_media.json [host] => https://upload.twitter.com/1/ [timeout] => 30 [connecttimeout] => 30 [ssl_verifypeer] => [format] => json [decode_json] => 1 [http_info] => Array ( [url] => https://upload.twitter.com/1/statuses/update_with_media.json [content_type] => application/json; charset=utf-8 [http_code] => 403 [header_size] => 1698 [request_size] => 583 [filetime] => -1 [ssl_verify_result] => 20 [redirect_count] => 0 [total_time] => 3.931 [namelookup_time] => 0 [connect_time] => 0.562 [pretransfer_time] => 3.448 [size_upload] => 383 [size_download] => 84 [speed_download] => 21 [speed_upload] => 97 [download_content_length] => 84 [upload_content_length] => 0 [starttransfer_time] => 3.931 [redirect_time] => 0 [certinfo] => Array ( ) ) [useragent] => TwitterOAuth v0.2.0-beta2 [sha1_method] => OAuthSignatureMethod_HMAC_SHA1 Object ( ) [consumer] => OAuthConsumer Object ( [key] => zqSQSuoyOHI6jgQ0xiStXQ [secret] => aHO56ruzQcWWCCBsMPwbffFzGlfSyQCy0YKK45mQg [callback_url] => ) [token] => OAuthConsumer Object ( [key] => 631898844-va9Tw74k9jQek4jEtnalM70q7Dg21y974HwP9GeY [secret] => 6GwOWij0ZanywcUjj1CZTT7JYkIRpHxS4uGHpf5k [callback_url] => ) [http_header] => Array ( [date] => Tue, 17 Jul 2012 07:20:01 GMT [server] => hi [status] => 403 Forbidden [x_transaction] => cf869201583e7df7 [x_mediaratelimit_remaining] => 30 [x_mediaratelimit_class] => photos [last_modified] => Tue, 17 Jul 2012 07:20:01 GMT [x_frame_options] => SAMEORIGIN [x_action_name] => update_with_media [x_mediaratelimit_limit] => 30 [content_type] => application/json; charset=utf-8 [x_transaction_mask] => a6183ffa5f8ca943ff1b53b5644ef1143611b652 [x_runtime] => 0.08577 [pragma] => no-cache [content_length] => 84 [x_access_level] => read-write-directmessages [x_mediaratelimit_reset] => 1342596001 [x_controller_class] => Api::StatusController [cache_control] => no-cache, no-store, must-revalidate, pre-check=0, post-check=0 [expires] => Tue, 31 Mar 1981 05:00:00 GMT [x_mid] => 7bb78f49341e8c5dcfa44025e6f7f4df10de851d [set_cookie] => _twitter_sess=BAh7CToMY3NyZl9pZCIlYzFmMjE3ZTFlMDM1NzY1MTE4MmMyOTE0Y2I3OTM3%250AMzI6D2NyZWF0ZWRfYXRsKwi40s6TOAE6B2lkIiVjZDQ1MWFjNTRmNjViYThi%250ANzhmYTdkZmQwYzZjM2ViZSIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6%250ARmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7AA%253D%253D–4b0392078918f241e6d9aefa81c8f1048b369d8b; domain=.twitter.com; path=/; HttpOnly [vary] => Accept-Encoding ) )
'
Can anyone help …?


#2

I could solve it by using only using base64_encoded string. No need to use any other meta information.