# UploadFile > AstrolUploadFile is a Blazor component that 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 the removal of uploaded files before they are saved. Source page: https://doc.astrolui.com/basic-component/upload-file ## 1. Demo AstrolUploadFile In this example, [notifications](/basic-component/notification) and [buttons](/basic-component/button) 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. ```razor @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 @code { ``` ```csharp private bool _statusUpload = false; private async Task SaveFile(List files) { ChangeStatus(false); await jsI.Notification($"Attaching {files.Count} file(s).".NotificationSuccess("astrol-upload-cloud", false)); } private void ChangeStatus(bool newStatus) { _statusUpload = newStatus; } } ``` ### Supported parameters - Status **(bool)**, visibility of the upload modal. - OnClose **(EventCallback)**, raised with **false** when the modal closes (Close button, X, click outside or **Esc**); update your state variable here. - Save **(EventCallback>)**, raised when Save is pressed, with the selected files (the button is enabled when there is at least one). The modal does not close by itself: close it in this event. If the event throws, its message is shown as an error notification. - Draggable **(bool)**, the modal can be moved (default **true**). - Resizable **(bool)**, the modal can be resized (default **false**). - Outline **(bool)**, outline style for the modal and its buttons (default **false**). - MultipleFile **(bool)**, allows several files; when false, each new file replaces the previous one (default **true**). - MaxNumberOfFiles **(int)**, maximum number of files (default **10**). - MaxFileSize **(long)**, maximum size per file, in the unit set in **TypeStorage** (default **5**). - TypeStorage **(TypeStorage)**, unit of **MaxFileSize** (default **TypeStorage.Megabyte**): Byte, Kilobyte, Megabyte, Gigabyte, Terabyte, Petabyte (**@using Astrol.Entities.Basic.Enums**). - SupportedExtensions **(List)**, allowed extensions including the dot (e.g. **".pdf"**), case-insensitive; they also filter the file browser. **If not set, any file is allowed**. - IconLoad **(string)**, loading icon (default **astrol-spin1**). - Title, TextClose, TextSave **(string)**, modal title and button texts. - TextBrowse **(string)**, drop zone text; TextFileName and TextFileSize **(string)**, name and size labels of each file. - TextErrorMaximumNumberFilesAccepted, TextErrorWrongFileExtension, TextErrorFileTooBig **(string)**, error messages. - All texts are optional: by default they follow the app language. - Besides browsing and drag and drop, files can be **pasted** (Ctrl+V) into the drop zone. - **AstrolUploadFileEmbedded**: the same drop zone without modal or Save button. It accepts MultipleFile, MaxNumberOfFiles, MaxFileSize, TypeStorage, SupportedExtensions, IconLoad, TextBrowse, TextFileName, TextFileSize and the error texts, plus: - OnChange **(EventCallback>)**, receives the full list of files every time one is added or removed. - CopyZone **(ElementReference?)**, element that receives pastes (defaults to the component itself). ## 2. Demo AstrolUploadFileEmbedded ```razor @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 @code { ``` ```csharp private async Task OnChange(List files) { await jsI.Notification($"Attaching {files.Count} file(s).".NotificationSuccess("astrol-upload-cloud", false)); } } ```