# InteractionFile

- Kind: `class`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.5.3`
- Namespace: `Aspire.Hosting`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/b5f143315ffb6968ea939a9978797a5b20e4c688/src/Aspire.Hosting/IInteractionService.cs)

Represents a file selected by the user for an [InputType.File](/reference/api/csharp/aspire.hosting/inputtype/fields.md) input.

## Definition

```csharp
namespace Aspire.Hosting;

public sealed class InteractionFile
{
    // ...
}
```

## Properties

- [FilePath](/reference/api/csharp/aspire.hosting/interactionfile/properties.md#filepath) : `string` `get` -- Gets the full path to the uploaded file on disk.
- [Id](/reference/api/csharp/aspire.hosting/interactionfile/properties.md#id) : `string` `get` -- Gets the unique identifier for the uploaded file.
- [Name](/reference/api/csharp/aspire.hosting/interactionfile/properties.md#name) : `string` `get` -- Gets the original file name as provided by the user (e.g. "readme.txt").

## Methods

- [OpenRead](/reference/api/csharp/aspire.hosting/interactionfile/methods.md#openread) : `Stream` -- Opens a read-only stream for the file content.
- [ReadAllBytesAsync(CancellationToken)](/reference/api/csharp/aspire.hosting/interactionfile/methods.md#readallbytesasync-cancellationtoken) : `Task<byte[]>` -- Reads all bytes of the file asynchronously.
