In this example, notifications and buttons are implemented, so it is recommended to refer to the respective documentation.
The AstrolUploadFile component provides the logic for browsing files in the explorer, copying and pasting, as well as dragging and dropping files into the defined area. It also allows for deleting uploaded files before they are saved.
@using Astrol.Component.Basic.Button@using Astrol.Component.Basic.UploadFile@using Astrol.Entities.Basic.Static.Notification@using Astrol.Entities.Basic.UI@using Astrol.JSInterop.Base@inject AstrolJSInterop jsI <AstrolButton OnClick="_=>ChangeStatus(true)" Icon="astrol-upload-cloud" Text="Upload file" Style="AstrolStyle.Blue" /><AstrolUploadFile Status="@_statusUpload" SupportedExtensions="@(new List<string> {".jpg",".svg",".png",".pdf",".xlsx"})" Save="SaveFile" OnClose="ChangeStatus" /><!-- Texts are optional (they follow the app language), e.g. Title="Upload file" TextSave="Save" -->@code { private bool _statusUpload = false; private async Task SaveFile(List<IBrowserFile> files) { ChangeStatus(false); await jsI.Notification($"Attaching {files.Count} file(s).".NotificationSuccess("astrol-upload-cloud", false)); } private void ChangeStatus(bool newStatus) { _statusUpload = newStatus; }}@using Astrol.Component.Basic.UploadFile@using Astrol.Entities.Basic.Static.Notification@using Astrol.Entities.Basic.Enums@using Astrol.Entities.Basic.UI@using Astrol.JSInterop.Base@inject AstrolJSInterop jsI <AstrolUploadFileEmbedded MaxFileSize="5" TypeStorage="TypeStorage.Megabyte" MaxNumberOfFiles="10" MultipleFile="true" SupportedExtensions="@(new List<string> {".jpg",".png",".svg",".pdf",".xlsx"})" OnChange="OnChange" />@code { private async Task OnChange(List<IBrowserFile> files) { await jsI.Notification($"Attaching {files.Count} file(s).".NotificationSuccess("astrol-upload-cloud", false)); }}