Upload image in a tweet


#1

Hy all thanks for helpme,
i have an error, when try to upload an image to twitter i get thi messaged ‘not recognized’,
i use the REST api - https://upload.twitter.com/1.1/media/upload.json, and this is my code:

Rails

url = 'https://upload.twitter.com/1.1/media/upload.json
media = 'http://cdn.example.com/post/543272676c6933174e000000/image-medium.jpg?1412592229
response = access_token.post(url, feed.merge(‘media’ => media, ‘status’ => ‘text’))

any idea for a bug ??
thanks


#2

Check the comment from this post: Uploading Base64 Encoded Image using /1.1/media/upload.json


#3

I have not figured out how to solve the problem,
is because the media is not in base 64?


#4

yes, that was the case on my side. also take care that the base64_encode size to not exceed the 3MB default limit (will not happen with normal images)