小编klb*_*klb的帖子

如何使用nodejs在azure blob存储上设置contenttype

我有一个nodejs服务器,我正在使用azure-storage模块,我正在尝试将wav文件上传到azure blob存储.

我正在尝试将blob上的contentType设置为'audio/wav',但它在存储中显示为'application/octet-stream'.代码是:

 upload: function (id, buffer, mimeType, callback) {
    self = this;
    var size = buffer.length;
    var stream = streamifier.createReadStream(buffer);
    var options = { contentType: 'audio/wav' };
    self.blobService.createBlockBlobFromStream(self.containerName, id, stream, size, options,  function (error, result, response) {
        if (error) {
            callback(error);
        }
        callback(null);
    });
}
Run Code Online (Sandbox Code Playgroud)

关于我做错了什么的任何想法?

azure azure-storage node.js contenttype

7
推荐指数
2
解决办法
1406
查看次数

标签 统计

azure ×1

azure-storage ×1

contenttype ×1

node.js ×1