Skip to content

Commit

Permalink
docs: added example
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorShadurin committed Oct 14, 2023
1 parent 873a68c commit d0323b2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,14 @@ await fdp.file.downloadData('my-new-pod', '/myfile.txt', {
console.log(event)
}
})

// or you can download data block-by-block to combine it later
const blockSize = 1000000
const fileMeta = await fdp.file.getMetadata(pod, fullPath)
const result = new Uint8Array(fileMeta.fileSize)
for (let i = 0; i < blocksCount; i++) {
result.set(await fdp.file.downloadDataBlock(fileMeta, i), i * blockSize)
}
```

Deleting a pod
Expand Down

0 comments on commit d0323b2

Please sign in to comment.