【发布时间】:2011-06-27 11:03:08
【问题描述】:
如何使用 knox 上传带有 node.js 的文件?
https://github.com/LearnBoost/knox
上传到 node.js 的完整代码是什么,从路由到使用 knox 上传?我认为那里的文档只涵盖了他们将其放到 s3 上的部分。
put 例子:
fs.readFile('Readme.md', function(err, buf){
var req = client.put('/test/Readme.md', {
'Content-Length': buf.length
, 'Content-Type': 'text/plain'
});
req.on('response', function(res){
if (200 == res.statusCode) {
console.log('saved to %s', req.url);
}
});
req.end(buf);
});
但是 Readme.md 是从哪里来的呢?
谢谢。
【问题讨论】:
标签: javascript file-upload amazon-s3 node.js