# FileVer

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.FileVer/

Identifies one version of a file.

Use the `file_ver` of a [File](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.File/index.md) returned by the server. The download methods
and `GetFileSize` need a specific file version: `FILE_VER_TYPE_LATEST` fails with "Not found.
(File <id>-0 not found.)". To find the latest version of a file, use `GetLatestFileVersion`.

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

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

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-file_id"></a>`file_id` | [`FileID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FileID/index.md) | 1 | The file. |
| <a id="f-type"></a>`type` | [`FileVerType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.FileVerType/index.md) | 2 | `FILE_VER_TYPE_SPECIFIC` for a file version number. Values: `FILE_VER_TYPE_UNINITIALIZED` (0), `FILE_VER_TYPE_LATEST` (1), `FILE_VER_TYPE_ANY` (2), `FILE_VER_TYPE_SPECIFIC` (3). |
| <a id="f-internal_version"></a>`internal_version` | `int32` | 3 | The file version number. |
| <a id="f-external_repository_version"></a>`external_repository_version` | `string` | 4 | Used only for files in external repositories. Leave empty. |
| <a id="f-external_repository_sort_key"></a>`external_repository_sort_key` | `int64` | 5 | Used only for files in external repositories. Leave 0. |

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

## Used by methods

- [IRPCObjectOperations.AddObjectFile](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/AddObjectFile/index.md): Adds new document file to a document.
- [IRPCObjectOperations.AddSingleFileDocument_SingleStep3](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/AddSingleFileDocument_SingleStep3/index.md): Creates a single-file document from inline file content and returns its file version. Older form; prefer AddObjectWithFiles with an inline file source.
- [IRPCObjectOperations.ConvertToPDF](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/ConvertToPDF/index.md): Converts the specified object file to PDF format.
- [IRPCObjectOperations.GetExternalEditingDetails](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/GetExternalEditingDetails/index.md): Gets the information a client needs to open a file in an external editing system (SharePoint Embedded).
- [IRPCObjectOperations.RelayMasterStorageOperations](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/RelayMasterStorageOperations/index.md): Relays file or object operations to Master Storage. Internal to M-Files; not for applications.
- [IRPCObjectOperations.RemoveObjectFile](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/RemoveObjectFile/index.md): Removes a file from a document.
- [IRPCObjectOperations.RenameObjectFile](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/RenameObjectFile/index.md): Renames a document file.
- [IRPCThumbnails.GetDocumentFileThumbnail](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCThumbnails/GetDocumentFileThumbnail/index.md): Gets a classic thumbnail or a first-page preview of one file of an object version, as PNG.

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

## Used in fields

- [`File.file_ver`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.File/index.md#f-file_ver): The file and its version. Pass it unchanged in an `ObjFileVer` to download the file.
- [`FileVerArray.value`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FileVerArray/index.md#f-value): Items.
- [`ObjFileVer.file_ver`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjFileVer/index.md#f-file_ver): The specific file version, as in `File.file_ver`.
- [`ObjOrFileVer.file_ver`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjOrFileVer/index.md#f-file_ver): File version. Valid only if bIsFile is true.
- [`SharedLinkInfo.file_ver`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SharedLinkInfo/index.md#f-file_ver): The file version referenced by the shared link.
- [`WOPIFileInfo.file_ver`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.WOPIFileInfo/index.md#f-file_ver): The file version referenced by the shared link.
- [`WOPIUserSession.file_ver`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.WOPIUserSession/index.md#f-file_ver): The FileVer of the object.
- [`AddSingleFileDocument_SingleStep3Response.file_ver`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/AddSingleFileDocument_SingleStep3/index.md#response): Always receives the file version. (represented by FileVer struct.)
- [`AddObjectFileResponse.file_ver`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/AddObjectFile/index.md#response): The new file's ID and version; pass it to UploadFile as `file.file_ver`.
- [`RemoveObjectFileRequest.file_ver`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/RemoveObjectFile/index.md#request): The file version.
- [`RenameObjectFileRequest.file_ver`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/RenameObjectFile/index.md#request): The file to be renamed.
- [`ConvertToPDFResponse.files`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/ConvertToPDF/index.md#response): Receives an array of file versions of the PDF files in the object version.
- [`GetExternalEditingDetailsRequest.file_ver`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/GetExternalEditingDetails/index.md#request): The file version whose authoring details you want.
- [`RelayMasterStorageOperationsRequest.file_ver`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/RelayMasterStorageOperations/index.md#request): The file version which is relayed to Master Storage.
- [`GetDocumentFileThumbnailRequest.file_ver`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCThumbnails/GetDocumentFileThumbnail/index.md#request): The file and its specific version, as in the [File](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.File/index.md) entries of the object version.
