I used the exact same code for the profile pic update except changing
the api function. The profile picture update works, but unfortunately
the background image update fails.

         $img_path = $_SERVER["DOCUMENT_ROOT"].'/images/twitter_bg/'.$image;

         require_once('./application/libraries/tmhOAuth.php');

          $oauth_tokens = $this->session->userdata('twitter_oauth_tokens');
          $tmhOAuth = new tmhOAuth(array(
            'consumer_key'    => T_CONSUMER_KEY,
            'consumer_secret' => T_CONSUMER_SECRET,
            'user_token'      => $oauth_tokens['access_token'],
            'user_secret'     => $oauth_tokens['access_token_secret']
         ));

          $img_post = array('image' => "@{$img_path};type=image/jpeg;");


         $tmhOAuth->request('POST', $tmhOAuth->url("account/
update_profile_background_image"), $img_post,
            true, // use auth
            true  // multipart
          );

The picture is jpg and only 40kb

The response I had:


(
           [date] => Mon, 18 Oct 2010 23:00:56 GMT
           [server] => hi
           [status] => 403 Forbidden
           [x_transaction] => 1287442856-44067-31467


[code] => 403
   [response] => {"error":"There was a problem with your background
image. Probably too big.","request":"/1/account/
update_profile_background_image.json"}


Thanks for taking a look.

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk

Reply via email to