# IRPCObjectOperations.DownloadTempFileFromUpload_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) > [Objects, versions, properties and files](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/index.md)

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

Badges: `Vault API / core` `read` `session or assertion` `idempotent`

Opens a download session for a committed upload, to read it back or as a PDF, without creating
an object.

- **Service:** [Objects, versions, properties and files](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/index.md) `MFiles.IRPCObjectOperations`
- **gRPC method:** `/MFiles.IRPCObjectOperations/DownloadTempFileFromUpload_Begin`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/download-temp-file-from-upload_-begin`
- **Request:** [`DownloadTempFileFromUpload_BeginRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/DownloadTempFileFromUpload_Begin/index.md#request)
- **Response:** [`DownloadTempFileFromUpload_BeginResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/DownloadTempFileFromUpload_Begin/index.md#response)
- **Book and level:** Vault API, core
- **Kind:** read
- **Session:** Required: a session (mfiles-session-id-bin metadata) or a session assertion (x-mf-session-assertion metadata).
- **Idempotent:** yes
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

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

## Remarks

Pass the `upload_id` of an upload committed with
[UploadTempFileCommit](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/UploadTempFileCommit/index.md); an uncommitted
upload fails. Read the content with
[DownloadFile_ReadBlock](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/DownloadFile_ReadBlock/index.md).
`FILE_FORMAT_PDF` returns a PDF rendition of the upload (for example to preview a document before
it is created); `file_extension` is then "pdf". The download session ends with the upload.

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

## Request: DownloadTempFileFromUpload_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 |
|---|---|---|
| `upload_id` | `int32` | The ID of a committed upload. 0 if `file_ref` is set. |
| `file_format` | [`FileFormat`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.FileFormat/index.md) | `FILE_FORMAT_NATIVE` (default) or `FILE_FORMAT_PDF`. Values: `FILE_FORMAT_NATIVE` (0), `FILE_FORMAT_PDF` (1), `FILE_FORMAT_DISPLAY_ONLY_PDF` (2), `FILE_FORMAT_PLAIN_TEXT` (3), `FILE_FORMAT_MARKDOWN` (4). |
| `file_ref` | `string` | The `file_ref` of an upload completed with `FileUploadEnd`, instead of `upload_id`. Set exactly one of the two. |
| `extension` | `string` | The file name extension, without the dot. Used only with `file_ref`. |

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

## Response: DownloadTempFileFromUpload_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 download session for `DownloadFile_ReadBlock`. |
| `file_size` | `int64` | The size of the content to download, in bytes. |
| `file_extension` | `string` | The extension of the content to download; empty if the upload has none. |

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

## Related methods

- [UploadTempFileCommit](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/UploadTempFileCommit/index.md): Completes an upload made with UploadTempFile.
- [DownloadFile_ReadBlock](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/DownloadFile_ReadBlock/index.md): Reads a block of a file from a download session.
