簡體   English   中英

文件上傳到 Azure Data Lake Storage

[英]File Upload into Azure Data Lake Storage

我是 Node 新手,需要編寫一個 Node js 應用程序將一堆文件上傳到 Azure Data Lake 存儲,文件大小以 MB 為單位可以進入 GB,最好的方法是什么,任何節點包可以幫忙嗎? 任何指針高度贊賞。

可以使用@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);

}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM