【发布时间】:2016-01-26 03:11:52
【问题描述】:
我正在尝试在 IBM Bluemix Cloud 上使用 Object Storage Service,但我无法从我的 nodejs 服务器发送图像。我怎样才能做到这一点?按照我的服务器代码:
unirest
.post(MY_CONTAINER + new_fname)
.headers({'Content-Type': 'multipart/form-data', 'X-Auth-Token': token})
.field({ 'max_file_count': 1 })
.field({ 'max_file_size': 1 })
.attach({ 'file': file.originalname, 'relative file': streamFile })
.end(function (resp) {
//response
console.log(resp.status);
console.log(resp.body);
});
主要问题是找到使用 API 将图像(png 或 jpg)发送到 bluemix 存储的正确方法(我已将其上传到我们的服务器)。
【问题讨论】:
标签: node.js ibm-cloud object-storage