私はtwitを使用しています。更新ステータス (メディアなし) は正常に機能しますが、メディアを使用した更新は機能しません。
これは私のコードです(エクスプレスで使用):
//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);
}
);
});
私が得ているエラーは、「Missing or invalid url parameter」です。
経由で画像ファイルを送信するにはどうすればよいmedia[]
ですか?