Twitter API media/upload has image size limit <=5mb as per documentation.
But still it is not accepting my images having sizes from 5kb to 5mb. It is throwing me error something like “file size is exceeding”.
It is only accepting images with size below 5kb.
Example :-
When I post an image with 2KB size (media/upload API)
Response I get :- (SUCCESS)
{
"data": {
"created_at": "Fri May 06 04:36:03 +0000 2016",
"id": "728443182682267648",
"text": "See https:\/\/t.co\/eMKaVbqIah",
"favorited": false,
"retweeted": false,
"retweet_count": 0,
"favorite_count": 0,
"user": {
"name": "Varad Mondkar",
"screen_name": "varadmondkar",
"profile_image_url": "http:\/\/pbs.twimg.com\/profile_images\/378800000478332640\/80595cf404df09d5c52635f09381c0b1_normal.jpeg",
"profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/378800000478332640\/80595cf404df09d5c52635f09381c0b1_normal.jpeg"
},
"entities": {
"media": {
"id": 728443181084213248,
"media_url": "http:\/\/pbs.twimg.com\/media\/ChvzNreUgAAYS0L.png",
"media_url_https": "https:\/\/pbs.twimg.com\/media\/ChvzNreUgAAYS0L.png",
"type": "photo"
},
"urls": [
]
}
}
}
When I post an image with size above 5-6KB (media/upload API)
Response I get :- (FAILED)
(Response is to big so I am coming to main point without posting whole json)
error: {
"status_code": 200,
"message": Server error: `POST https://upload.twitter.com/1.1/media/upload.json?media='IMAGE-DATA'` resulted in 503 Service Temporarily Unavailable` response:{"errors":[{"message":"Over capacity","code":130}]}
}
Sometime I get error as :
error: {
"status_code": 200,
"message": Client error: `POST https://upload.twitter.com/1.1/media/upload.json?media='IMAGE-DATA'` resulted in a `400 Bad Request` response:\n\n"
}
So the success percent for uploading image above 5-6KB is ZERO 
Please help me with this.
Thank you.