[英]Node.JS Multipart upload to facebook graph
I'm trying to upload a photo to facebook and I can't find seem to get the multipart
upload working. 我正在尝试将照片上传到Facebook,我找不到似乎让
multipart
上传工作。 I can't find any documentation or libraries that do this. 我找不到执行此操作的任何文档或库。 Has anyone else had any luck with this?
还有其他人对此有什么好运吗?
Check out the restler library for this instead. 请改用restler库。 I've used it for this exact purpose, and it works great.
我已将其用于此确切目的,并且效果很好。
Here is some modified code from their examples to show how a file POST would go. 以下是他们的示例中的一些修改过的代码,以显示文件POST的方式。
// multipart request sending a file and using https
rest.post('https://twaud.io/api/v1/upload.json', {
multipart: true,
data: {
'sound[message]': 'hello from restler!',
'sound[file]': rest.file('doug-e-fresh_the-show.mp3', null, null, null, 'audio/mpeg')
}
}).on('complete', function(data) {
sys.puts(data.audio_url);
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.