简体   繁体   English

Node.JS Multipart上传到facebook图表

[英]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.

相关问题 尝试通过 node.js http 发布到“graph.facebook.com”时出现“读取 ECONNRESET”错误 - Getting "read ECONNRESET" error when trying to POST to 'graph.facebook.com' via node.js http 从 Flutter 客户端解析 Node.JS 中的多部分请求正文 - Parse Multipart Request Body in Node.JS from Flutter Client 在node.js中解析具有多部分内容类型的req的方法 - Method to parse req with multipart content type in node.js 从node.js将图像上传到Twitter API - Upload images to twitter API from node.js 在 node.js 上传应用程序中 60 秒后连接重置 - Connection resets after 60 seconds in node.js upload application 努力将我的 node.js 应用程序上传到 azure - Struggling to upload my node.js application to azure 发送带有curl的curl --upload-file头-> Node.js - Send curl with Expect --upload-file header -> Node.js 这是来自iPad的格式错误的http请求,它杀死了Node.js多部分解析器 - Is this a mal-formed http request from an iPad, which kills Node.js multipart parser 使用内置的http模块,使用multipart / form-data和node.js上载图像 - Uploading Images using multipart/form-data with node.js using the in-build http module 使用node.js上传HTTP文件正在更改文件 - HTTP file upload with node.js is changing the file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM