我正在尝试在IBM Bluemix Cloud上使用对象存储服务,但我无法从我的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);
});
Run Code Online (Sandbox Code Playgroud)
主要问题是找到使用API将图像(png或jpg)发送到bluemix存储的正确方法(我已经将它上传到我们的服务器).