# IRPCIndexingDataSource.CacheFileForIndexing

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Server integration API](https://developer.m-files.com/APIs/gRPC-API/integration/index.md) > [Indexing data source](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCIndexingDataSource/index.md)

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

Badges: `Server integration API / specialized` `internal: not for applications` `write` `session`

Writes a file version, in the requested format, to a temporary folder on the server computer and
returns its local path.

- **Service:** [Indexing data source](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCIndexingDataSource/index.md) `MFiles.IRPCIndexingDataSource`
- **gRPC method:** `/MFiles.IRPCIndexingDataSource/CacheFileForIndexing`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/cache-file-for-indexing`
- **Request:** [`CacheFileForIndexingRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCIndexingDataSource/CacheFileForIndexing/index.md#request)
- **Response:** [`CacheFileForIndexingResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCIndexingDataSource/CacheFileForIndexing/index.md#response)
- **Book and level:** Server integration API, specialized
- **Kind:** write
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** no
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

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

## Remarks

**For M-Files components only.** The M-Files indexing service, which runs on the server computer,
calls it. Applications should not call it: the result is a path on the server's own disk.
- Requires a vault session with the vault rights `see_all_objects` and `see_deleted_objects`.
- Creates a file that the caller owns and must delete. `sub_dir` must stay inside the indexing
  temporary folder; a path that leaves it fails with "The parameter is incorrect.".

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

## Request: CacheFileForIndexingRequest

A structure that specifies cache file for indexing request.

> 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 |
|---|---|---|
| `file_info_for_fix` | [`FileInfoForFIX`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FileInfoForFIX/index.md) | File info for indexing. |
| `file_info_for_fix.obj_file_ver` | [`ObjFileVer`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjFileVer/index.md) | File version. |
| `file_info_for_fix.obj_file_ver.obj_id` | [`ObjID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjID/index.md) | The object that owns the file. |
| `file_info_for_fix.obj_file_ver.file_ver` | [`FileVer`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FileVer/index.md) | The specific file version, as in `File.file_ver`. |
| `file_info_for_fix.is_destroyed` | `bool` | True if the file has been destroyed and is no longer available. If true then only the objfilever member is valid. |
| `file_info_for_fix.data_file_version` | `int32` | Data file version if the file is an internal file. |
| `file_info_for_fix.size` | `int64` | The logical size of the file in bytes. |
| `file_info_for_fix.extension` | `string` | The file extension, not including the dot (e.g. "doc"). This unencoded extension may contain characters that are not allowed in file extensions in file systems. |
| `file_info_for_fix.relevance_score` | `float` | Relevance score of the object. |
| `file_info_for_fix.file_ids[]` | repeated [`FileID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FileID/index.md) | All file IDs of the object's LCI version. |
| `file_info_for_fix.file_ids[].type` | [`FileIDType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.FileIDType/index.md) | `FILE_IDTYPE_SPECIFIC` for one file. Values: `FILE_IDTYPE_UNINITIALIZED` (0), `FILE_IDTYPE_ALL` (1), `FILE_IDTYPE_ANY` (2), `FILE_IDTYPE_SPECIFIC` (3). |
| `file_info_for_fix.file_ids[].internal_id` | `int32` | The file ID. |
| `file_info_for_fix.file_ids[].external_repository_id` | `string` | Used only for files in external repositories. Leave empty. |
| `file_info_for_fix.timestamp` | [`LogicalTimestamp`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.LogicalTimestamp/index.md) | Logical timestamp for indexing. |
| `file_info_for_fix.timestamp.type` | [`LogicalTimestampType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.LogicalTimestampType/index.md) | Logical timestamp type. Values: `LOGICAL_TIMESTAMP_TYPE_UNINITIALIZED` (0), `LOGICAL_TIMESTAMP_TYPE_IGNORED` (1), `LOGICAL_TIMESTAMP_TYPE_INTEGER` (2), `LOGICAL_TIMESTAMP_TYPE_STRING` (3), `LOGICAL_TIMESTAMP_TYPE_INTEGER_AND_STRING` (4). |
| `file_info_for_fix.timestamp.data` | [`LogicalTimestampUnion`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.LogicalTimestampUnion/index.md) | The data as a union. |
| `file_info_for_fix.object_data` | [`ObjectVersionExWP`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectVersionExWP/index.md) | If not null contains the basic object version information. The search results are returned from the server using this information with external content repositories. |
| `file_info_for_fix.object_data.object_version` | [`ObjectVersionEx`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectVersionEx/index.md) | Object info. |
| `file_info_for_fix.object_data.properties[]` | repeated [`PropertyValue`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.PropertyValue/index.md) | Property values, or an empty array. |
| `file_info_for_fix.object_data.acl` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) | If set, ACL. |
| `file_info_for_fix.object_data.current_user_permissions` | [`ObjectPermissionsForClient`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectPermissionsForClient/index.md) | If set, permissions of the object version. |
| `file_info_for_fix.last_modified_for_indexing` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | The last modified timestamp for indexing. |
| `file_info_for_fix.repository_path` | [`FolderArray`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FolderArray/index.md) | If not null contains the array of folders describing the repository path to the object version location. The search results are returned from the server using this information with external content repositories. |
| `file_info_for_fix.repository_path.value[]` | repeated [`Folder`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Folder/index.md) | Array of Folder structures. |
| `file_format` | [`FileFormat`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.FileFormat/index.md) | Specifies the requested file format to cache. Values: `FILE_FORMAT_NATIVE` (0), `FILE_FORMAT_PDF` (1), `FILE_FORMAT_DISPLAY_ONLY_PDF` (2), `FILE_FORMAT_PLAIN_TEXT` (3), `FILE_FORMAT_MARKDOWN` (4). |
| `sub_dir` | `string` | Optional subfolder under the vault's indexing temporary folder (`Filedata/Temp/FIX`). |

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

## Response: CacheFileForIndexingResponse

A structure that specifies cache file for indexing response.

> 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 |
|---|---|---|
| `full_path` | `string` | The full local path of the cached file on the server computer. |
| `file_format` | [`FileFormat`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.FileFormat/index.md) | The format actually produced, which can differ from the requested one. Values: `FILE_FORMAT_NATIVE` (0), `FILE_FORMAT_PDF` (1), `FILE_FORMAT_DISPLAY_ONLY_PDF` (2), `FILE_FORMAT_PLAIN_TEXT` (3), `FILE_FORMAT_MARKDOWN` (4). |

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

## Related methods

- [CacheFileForIndexingCollective](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCIndexingDataSource/CacheFileForIndexingCollective/index.md): Like CacheFileForIndexing, for up to 20 file versions in one call, processed in parallel.
