I want to upload an image from my hard drive, using an html form:
Image file: <input name="imageupload" id="imageupload" type="file" />
Then I upload it to twitter with:
image=self.request.get('imageupload')
image2=base64.b64encode(image)
twitapi.Update_profile_image(image=image2)
given twitapi.Update_profile_image:
def Update_profile_image(self,image):
if not self._oauth_consumer:
raise TwitterError("The twitter.Api instance must be authenticated.")
url = '%s/account/update_profile_image.json' % (self.base_url)
data = {'image':image}
json = self._FetchUrl(url, post_data=data)
data = self._ParseAndCheckTwitter(json)
return data
Given _FetchUrl from twitter-api
I always get
TwitterError: There was a problem with your picture. Probably too big.
Any ideas whee it comes from? Thanks!