Created
November 6, 2024 09:37
-
-
Save jonhilt/8b50b1e38dbe613fe956a49cbdbb44e0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @page "/Testing" | |
| <label class="fileInputZone" for="inputFile" title="Upload files"> | |
| Upload | |
| </label> | |
| <InputFile id="inputFile" OnChange="LoadFiles" multiple accept="@(String.Join(','))"/> | |
| @foreach (var uploadInfo in _queuedFileUploads) | |
| { | |
| <div style=""> | |
| <span>@uploadInfo.Name</span> | |
| <Button SelectedButtonType="ButtonType.Square" IconName="Icon.IconCross" Click="() => CancelUpload(uploadInfo)"></Button> | |
| </div> | |
| } | |
| @code { | |
| private readonly List<IBrowserFile> _queuedFileUploads = []; | |
| private void LoadFiles(InputFileChangeEventArgs obj) | |
| { | |
| Console.WriteLine("Uploading file"); | |
| _queuedFileUploads.Add(obj.File); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment