---
title: "Downloads a file from H2O Drive to the sandbox filesystem."
method: POST
path: "/v1/{name}/h2oDrive:downloadFile"
tags: ["H2ODriveService"]
---

# Downloads a file from H2O Drive to the sandbox filesystem.

`POST /v1/{name}/h2oDrive:downloadFile`

## Request

- Base URL: `https://docs.h2o.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.h2o.ai/v1/{name}/h2oDrive:downloadFile`
- Auth: none declared
- TypeScript: <https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto/docs/v1/:name/h2oDrive:downloadFile/post.ts> (a function with typed inputs; its response is checked against the schema)

Retrieves a file from the remote storage and writes it to the specified
path in the sandbox filesystem. The caller must have read permissions for
the specified workspace.

Authorization: Only the creator of the parent SandboxEngine is allowed to call this method.

## Path parameters

- `name` string, required

## Request body

- object: Request to download a file from H2O Drive.
  - `workspace` string: Optional. The workspace resource name. Format: workspaces/{workspace} If not specified, the default workspace in which the sandbox engine is running will be used.
  - `remotePath` string, required
  - `localPath` string, required: Required. The absolute path in the sandbox filesystem where the file should be written. Must start with a forward slash (e.g., "/home/sandbox/data/input.csv"). If the file doesn't exist, it will be created with 0644 permissions (rw-r--r--).
  - `createParentDirectories` boolean: Optional. If true, creates parent directories if they don't exist. If false or unspecified, the operation will fail if parent directories don't exist.
  - `overwrite` boolean, nullable: Optional. Controls overwrite behavior for existing files. If true or unspecified, overwrites the file if it already exists. If explicitly set to false, the operation will fail if the file exists.

## Response `200`

A successful response.

- V1DownloadFileResponse: Response after downloading a file.
  - `fileInfo` V1FileInfo: FileInfo contains metadata about a file or directory.
    - `path` string: Output only. The absolute path of the file or directory.
    - `size` string, int64: Output only. The size of the file in bytes. For directories, this is typically 0 or the size of the directory metadata.
    - `type` 'FILE_TYPE_UNSPECIFIED' | 'FILE_TYPE_REGULAR' | 'FILE_TYPE_DIRECTORY' | 'FILE_TYPE_SYMLINK': FileType indicates the type of filesystem entry. - FILE_TYPE_UNSPECIFIED: The file type is not specified. - FILE_TYPE_REGULAR: A regular file. - FILE_TYPE_DIRECTORY: A directory. - FILE_TYPE_SYMLINK: A symbolic link.
    - `modifyTime` string, date-time: Output only. The last modification time of the file or directory (mtime).
    - `mode` string: Output only. Unix file mode and permission bits in octal notation. The format follows standard Unix permissions represented as a string. Examples: "0644" (rw-r--r--), "0755" (rwxr-xr-x), "0777" (rwxrwxrwx).

## Other responses

- `default`: An unexpected error response.

---

[API](https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto.md) - [All operations](https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto/revisions/297cfadc1d39?raw)
