# OpcFileInfo Class

> Reference: Provides a default implementation of the IOpcFileInfo interface representing a FileInfo for the use in OPC UA.

<span class="api-meta">since v2.16</span>

<dl class="api-definition">
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx">Opc.UaFx</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Members</dt>
<dd><a href="./members">OpcFileInfo Members</a></dd>
</dl>

Provides a default implementation of the [IOpcFileInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcfileinfo/) interface representing a [FileInfo](https://learn.microsoft.com/dotnet/api/system.io.fileinfo) for the use in OPC UA.

## Syntax

<div class="api-signature" data-lang="csharp">

```csharp
public class OpcFileInfo
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Class OpcFileInfo
```

</div>

## Inheritance

[Object](https://learn.microsoft.com/dotnet/api/system.object) → **OpcFileInfo**

## Implements

<ul class="api-implements">
<li><a href="../opc.uafx.iopcfileinfo/">IOpcFileInfo</a></li>
</ul>

## Constructors

| Name | Description |
|---|---|
| [OpcFileInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfileinfo/members#opcfileinfo)<span class="api-meta">2 overloads</span> | Initializes a new instance of the OpcFileInfo class with the `filePath` specified. |

## Properties

| Name | Description |
|---|---|
| [Exists](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfileinfo/members#exists) | Gets a value indicating whether a file exists. |
| [IsReadOnly](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfileinfo/members#isreadonly)<span class="api-meta">virtual</span> | Gets or sets a value that determines if the current file is read only. |
| [Length](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfileinfo/members#length) | Gets the size, in bytes, of the current file. |
| [UnderlyingFileInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfileinfo/members#underlyingfileinfo) | Gets the underlying [FileInfo](https://learn.microsoft.com/dotnet/api/system.io.fileinfo) used by the current OpcFileInfo. |

## Methods

| Name | Description |
|---|---|
| [GetMimeType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfileinfo/members#getmimetype) | Determines the internet media type (mime- or content-type) of the file. |
| [Open](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfileinfo/members#open)<span class="api-meta">virtual</span> | Opens a file in the specified mode. |
| [OpenCore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfileinfo/members#opencore)<span class="api-meta">protected · virtual · since v2.17</span> | Opens the underlying file info with the specified mode, access, and share. |
| [Refresh](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfileinfo/members#refresh) | Refreshes the state of the object. |

## Applies to

| Package | Versions |
|---|---|
| Opc.UaFx.Advanced | v2.16–v2.59 |
