# InteractionFile

- Kind: `class`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `17.0.0`
- Namespace: `Aspire.Hosting`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/2d325b13709752ba6d9a943635c5e2940a2530c0/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.
