【发布时间】:2011-02-14 20:46:04
【问题描述】:
我将如何在快递应用程序中做到这一点?那是, 将文件发布到 Facebook:
curl -F 'access_token=xyz' \
-F 'source=@file.png' \
-F 'message=Caption for the photo' \
https://graph.facebook.com/me/photos
我正在使用以下内容从 repo 中的示例上传文件:
app.post('/', function(req, res, next){
req.form.complete(function(err, fields, files){
if (err) {
next(err);
} else {
console.log('\nuploaded %s to %s'
, files.image.filename
, files.image.path);
res.redirect('back');
}
});
})
【问题讨论】: