I am using twit(https://github.com/ttezel/twit).Update status(without media) works fine.But update with media(https://dev.twitter.com/docs/api/1.1/post/statuses/update_with_media) is not working. This is my code:(used with express)
//client side
<form id="tweeter" action='/image' method='POST' >
<input type="text" name="tw" id="tw" />
<input type='file' name='img' id='img' />
<input type="submit" value="submit" />
</form>
//server side
app.post('/image',function(req,res){
var f="./"+req.body.img;
console.log(req.body.img);
T.post('statuses/update_with_media', {status: req.body.tw,
"media[]":[f]}, function(err, reply) {
console.log('ERROR:'+err);
console.log('REPLY:'+reply);
});
});
The error I get is ‘Missing or invalid url parameter’. How should I send the image file via media[]?Thank you in advance!