【发布时间】:2017-04-11 10:26:54
【问题描述】:
我正在使用NPM documentation 将图像上传到谷歌云存储
app.post('/test', upload.single('image'), function (req, res, next) {
});
let bucket = gcs.bucket('bucket-name');
bucket.upload(req.file.path, function(err, file) {
if (err) {
throw new Error(err);
}
console.log(file);
});
console.log(req.file);
// req.body will hold the text fields, if there were any
})
有什么方法可以为我上传的文件指定自定义名称和文件类型?就我而言,它应该是一张图片。
【问题讨论】:
标签: node.js google-app-engine google-cloud-storage