# FileUploadWholeHeader

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Reference](https://developer.m-files.com/APIs/gRPC-API/Reference/index.md) > [Messages](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/index.md)

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

The first message of the FileUploadWhole request stream.

- **Full name:** `MFiles.FileUploadWholeHeader`
- **Proto file:** [`mfiles/IRPCFileTransferStreaming.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/IRPCFileTransferStreaming.proto)

<a id="fields"></a>

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-obj_id"></a>`obj_id` | [`ObjID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjID/index.md) | 1 | The id of the object to which the file is bound, if attaching immediately.<br>If set, together with file, attach the content to this object's file immediately. If not set, the content is only stored as a stateless temp file, retrievable later via the returned file_ref, using a separate FileUploadAttach call. obj_id and file must either both be set or both be omitted. |
| <a id="f-file"></a>`file` | [`File`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.File/index.md) | 2 | Information about the uploaded file, if attaching immediately. |
| <a id="f-file_size"></a>`file_size` | `uint64` | 3 | The size of the whole file content in bytes. Required.<br>The content must be exactly this size. Zero means an empty file. The server uses the size to reject a file that exceeds the maximum upload size before any content is sent, and to stream the content forward as it is received. |

<a id="used-by-methods"></a>

## Used by methods

- [IRPCFileTransferStreaming.FileUploadWhole](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCFileTransferStreaming/FileUploadWhole/index.md): Uploads a whole file by streaming its content.

<a id="used-in-fields"></a>

## Used in fields

- [`FileUploadWholeRequest.header`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCFileTransferStreaming/FileUploadWhole/index.md#request): The first message of the stream. Describes the upload.
