我是Node的新手,需要写一个Node js应用程序来上传一堆文件到Azure Data Lake商店,文件大小是MB可以进入GB,什么是最好的方法来做到这一点,任何节点包可以帮助相同的?任何指点都非常感谢。
发布于 2020-03-18 15:17:55
您可以使用@azure/storage-file-datalake包与Azure Data Lake Storage进行交互。你可以在这里找到一些与之交互的示例:https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-directory-file-acl-javascript。
用于从same link上载文件的代码示例
async function UploadFile(fileSystemClient) {
const fs = require('fs')
var content = "";
fs.readFile('mytestfile.txt', (err, data) => {
if (err) throw err;
content = data.toString();
})
const fileClient = fileSystemClient.getFileClient("my-directory/uploaded-file.txt");
await fileClient.create();
await fileClient.append(content, 0, content.length);
await fileClient.flush(content.length);
}https://stackoverflow.com/questions/60734392
复制相似问题