当为 nods.js 使用 aws-sdk npm 插件时,我可以使用以下代码上传 50kb 的 pdf(到 AWS s3):
var params = {
Bucket: BUCKET,
Key: pdf_key,
Body: file,
ContentType: 'application/pdf'
};
var s3 = new AWS.S3();
s3.putObject(params, function(error, data) {
console.log(data);
console.log(error);
if (error) {
console.log(error);
callback(error, null);
} else {
callback(null, pdf_key);
}
});
但是,当上传 11mb pdf 时,即使指定了ContentLength
,上传也会永远持续下去,即使超时 2 分钟也是如此。
问题是如何让 aws s3 接受大的 pdf 文件?
更新
我仍然没有找到该问题的任何文档或答案。
更新 2
我将接受显示这个或其他可以做到这一点的框架的答案。我将需要该框架还能够允许对对象进行身份验证。
更新 3 我现在让它工作,但我还没有找到它不应该工作的原因。
提前致谢!