Azure/azure-storage-js

10.2.0 cannot support chinese file name

sandboxol opened this issue · 1 comments

Which service(blob, file, queue, table) does this issue concern?

blob

Which version of the SDK was used?

10.2.0 and 10.1.0

What's the Node.js/Browser version?

v10.14.1

What problem was encountered?

Using chinese file name cannot upload to blob container

Steps to reproduce the issue?

use the following function and filepath must contain chinese or other utf8 string
async function uploadStream(aborter, containerURL, filePath) {

filePath = path.resolve(filePath);


const fileName = encodeURI(path.basename(filePath))
console.log(`${fileName} ${containerURL}`)
const blockBlobURL = BlockBlobURL.fromContainerURL(containerURL, "test/"+fileName);
console.log(`${blockBlobURL}`)

const stream = fs.createReadStream(filePath, {
  highWaterMark: FOUR_MEGABYTES,
});

const uploadOptions = {
    bufferSize: FOUR_MEGABYTES,
    maxBuffers: 5,
};

return await uploadStreamToBlockBlob(
                aborter, 
                stream, 
                blockBlobURL, 
                uploadOptions.bufferSize, 
                uploadOptions.maxBuffers);

}

Have you found a mitigation/solution?

It's a bug, thanks for reporting!