# FileInfo Class

Represents a file which the user selects for upload via [RadzenUpload](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenUpload.md).

Namespace: [Radzen](https://blazor.radzen.com/docs/api/Radzen.md)

Assembly: Radzen.Blazor.dll

## Inheritance

- Object
- FileInfo

Derived types: [PreviewFileInfo](https://blazor.radzen.com/docs/api/Radzen.PreviewFileInfo.md)

## Implements

- Forms.IBrowserFile

## Syntax

```csharp
public class FileInfo : Forms.IBrowserFile
```

## Constructors

| Constructor | Description |
|-------------|-------------|
| `public FileInfo()` | Creates FileInfo. |
| `public FileInfo(Forms.IBrowserFile source)` | Creates FileInfo. |

## Properties

| Property | Type | Description |
|------|------|-------------|
| ContentType | `string` | Gets the ContentType. |
| Id | `string` | Gets or sets the identifier of this selection. Stable until the file leaves the upload selection. This identifier is not sent to the upload endpoint. |
| LastModified | `DateTimeOffset` | Gets the LastModified. |
| Name | `string` | Gets the name of the selected file. |
| Size | `long` | Gets the size (in bytes) of the selected file. |
| Source | `Forms.IBrowserFile` | Gets the IBrowserFile source. |

## Methods

| Method | Returns | Description |
|------|---------|-------------|
| `OpenReadStream(long maxAllowedSize, Threading.CancellationToken cancellationToken)` | `IO.Stream` | Open read stream. Parameters: `maxAllowedSize`: The maximum allowed size. `cancellationToken`: The cancellation token. Returns: The stream. |

