小编Fel*_*lli的帖子

如何将文件上传到Bluemix中的对象存储(由nodejs)

我正在尝试在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存储的正确方法(我已经将它上传到我们的服务器).

node.js object-storage ibm-cloud

2
推荐指数
1
解决办法
2457
查看次数

标签 统计

ibm-cloud ×1

node.js ×1

object-storage ×1