Download a B2 file to local disk
b2_download_fileDownload a file from a Backblaze B2 bucket to a local folder, returning its saved path, size, type, and SHA-1 hash. Use overwrite to replace existing files.
Instructions
Downloads a file from a bucket to the local filesystem and returns where it landed, its size, type, and SHA-1. The destination must sit inside the directory named by B2_DOWNLOAD_ROOT. An existing file is not replaced unless overwrite is true. File content is never returned, only the path it was written to.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fileName | Yes | Name of the file in the bucket. | |
| localPath | No | Destination inside B2_DOWNLOAD_ROOT. Defaults to the file base name. | |
| overwrite | No | Replace an existing destination file. Defaults to false. | |
| bucketName | Yes | Name of the bucket to read from. |