New to Telerik UI for Blazor? Start a free 30-day trial
PromptBox File Attachments
Updated on Feb 10, 2026
The Blazor PromptBox component provides integrated file attachment functionality that allows users to select and attach files directly within the input interface. This feature is essential for AI communication scenarios where users need to provide documents, images, or other files as context for their prompts.
File attachment functionality is controlled through the EnableFileSelect parameter and configured using the PromptBoxFileSelectButtonSettings within the PromptBoxSettings section.
To enable file attachment functionality, set the EnableFileSelect parameter to true:
Basic file attachment setup
<TelerikPromptBox @bind-Value="@Prompt"
EnableFileSelect="true"
Placeholder="Type or attach files...">
<PromptBoxSettings>
<PromptBoxFileSelectButtonSettings AllowedExtensions="@AllowedExtensions"
Multiple="true"
OnSelect="@OnFilesSelected" />
</PromptBoxSettings>
</TelerikPromptBox>
@code {
private string Prompt = string.Empty;
private List<string> AllowedExtensions = new List<string> { ".pdf", ".png", ".jpg", ".jpeg", ".gif", ".txt" };
private void OnFilesSelected(FileSelectEventArgs args)
{
foreach (var file in args.Files)
{
Console.WriteLine($"File selected: {file.Name} ({file.Size} bytes)");
}
}
}
File Selection Parameters and Events
To review all available parameters and events for the PromptBox file select settings, see the PromptBoxFileSelectButtonSettings API Reference.