# CFX::LOAD_RESOURCE_FILE

- **Hash:** `0x76A9EE1F`
- **Namespace:** CFX
- **Runtime name (Lua/JS):** `LoadResourceFile`
- **Side:** shared (Cfx runtime native)
- **Name status:** official
- **Documentation:** described
- **URL:** https://natives.borderlinerp.com/natives/CFX/LOAD_RESOURCE_FILE

## Signature

```c
char* LOAD_RESOURCE_FILE(char* resourceName, char* fileName);
```

## Parameters

- `resourceName` (`char*`) — The resource name.
- `fileName` (`char*`) — The file in the resource.

## Returns

`char*` — The file contents

## Description

*Source: Cfx.re native reference*

Reads the contents of a text file in a specified resource.
If executed on the client, this file has to be included in `files` in the resource manifest.
Example: `local data = LoadResourceFile("devtools", "data.json")`

## Usage

### Lua

```lua
local retval = LoadResourceFile(resourceName, fileName)

-- always available, by hash
local retval = Citizen.InvokeNative(0x76a9ee1f, resourceName, fileName, Citizen.ResultAsString())
```

### JavaScript

```js
const retval = LoadResourceFile(resourceName, fileName);

// by hash
const retval = Citizen.invokeNative('0x76a9ee1f', resourceName, fileName, Citizen.returnResultAnyway(), Citizen.resultAsString());
```

### C#

```csharp
string retval = Function.Call<string>((Hash)0x76a9ee1f, resourceName, fileName);
```

## See also

- [CFX::SAVE_RESOURCE_FILE](https://natives.borderlinerp.com/natives/CFX/SAVE_RESOURCE_FILE.md) — Writes the specified data to a file in the specified resource.

*Sources: Cfx.re native reference.*
