Skip to content

Commit

Permalink
docs(fileselect): Add note to FileSelect OnSelect example (#1959)
Browse files Browse the repository at this point in the history
Co-authored-by: Dimo Dimov <[email protected]>
  • Loading branch information
github-actions[bot] and dimodi authored Mar 5, 2024
1 parent eddea44 commit 50cbc0f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/fileselect/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ The event handler receives a [`FileSelectEventArgs` object](#fileselectfileinfo)
private async Task UploadFile(FileSelectFileInfo file)
{
// This code will work in Blazor Server apps.
// Saving files on the user device is not allowed in WebAssembly apps.
Tokens.Add(file.Id, new CancellationTokenSource());
var path = Path.Combine(HostingEnvironment?.WebRootPath, file.Name);
await using FileStream fs = new FileStream(path, FileMode.Create);
Expand Down

0 comments on commit 50cbc0f

Please sign in to comment.