# IRPCClientScript.DownloadScriptApplicationFile_Begin

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Vault API](https://developer.m-files.com/APIs/gRPC-API/vault/index.md) > [Client scripts and UI extension applications](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCClientScript/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCClientScript/DownloadScriptApplicationFile_Begin/

Badges: `Vault API / standard` `read` `session` `idempotent`

Starts downloading the package (ZIP file) of an application and returns its first block.

- **Service:** [Client scripts and UI extension applications](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCClientScript/index.md) `MFiles.IRPCClientScript`
- **gRPC method:** `/MFiles.IRPCClientScript/DownloadScriptApplicationFile_Begin`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/download-script-application-file_-begin`
- **Request:** [`DownloadScriptApplicationFile_BeginRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCClientScript/DownloadScriptApplicationFile_Begin/index.md#request)
- **Response:** [`DownloadScriptApplicationFile_BeginResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCClientScript/DownloadScriptApplicationFile_Begin/index.md#response)
- **Book and level:** Vault API, standard
- **Kind:** read
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** yes
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

- Continue with
  [DownloadScriptApplicationFile_ReadBlock](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCClientScript/DownloadScriptApplicationFile_ReadBlock/index.md)
  from offset `len(data)` until `file_size` bytes have been read. If the first block already
  holds the whole file, the download is finished and `download_id` cannot be used.
- `block_size` is at most 4194304 (4 MiB); larger values fail with "Block size exceeded the
  limit of 4194304 bytes.". 0 returns no data.

<a id="request"></a>

## Request: DownloadScriptApplicationFile_BeginRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `script_application` | `string` | The GUID of the application. |
| `block_size` | `uint32` | The number of bytes to return in `data`, at most 4 MiB. |

<a id="response"></a>

## Response: DownloadScriptApplicationFile_BeginResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `download_id` | `int32` | The ID of the download, for the next blocks. |
| `file_size` | `int64` | The size of the package in bytes. |
| `data` | `bytes` | The first block of the package. |

<a id="related"></a>

## Related methods

- [DownloadScriptApplicationFile_ReadBlock](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCClientScript/DownloadScriptApplicationFile_ReadBlock/index.md): Reads the next block of an application download.
- [DownloadScriptApplication](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCClientScript/DownloadScriptApplication/index.md): Not implemented: fails with "Not implemented.".
