Watch Aspire live streamsDocsTry Aspire

InteractionFile Methods

ClassMethods2 members
Represents a file selected by the user for an InputType.File input.
Opens a read-only stream for the file content.
public sealed class InteractionFile
{
public Stream OpenRead()
{
// ...
}
}
StreamA IO.Stream for reading the file.
ObjectDisposedExceptionThe owning InteractionFileCollection has been disposed.
The returned stream remains usable if the owning InteractionFileCollection is disposed. Dispose the stream when reading is complete so the operating system can finish reclaiming the deleted file.
ReadAllBytesAsync(CancellationToken)Section titled ReadAllBytesAsync(CancellationToken)Task<byte[]>
Reads all bytes of the file asynchronously.
public sealed class InteractionFile
{
public Task<byte[]> ReadAllBytesAsync(
CancellationToken cancellationToken = default(CancellationToken))
{
// ...
}
}
cancellationTokenCancellationTokenoptionalA token to monitor for cancellation requests.
Task<byte[]>A byte array containing the file content.
ObjectDisposedExceptionThe owning InteractionFileCollection has been disposed.