<SfUploader @ref="UploadObj" ID="UploadFiles" Multiple=false> <UploaderAsyncSettings SaveUrl="https://ej2.syncfusion.com/services/api/uploadbox/Save" RemoveUrl="https://ej2.syncfusion.com/services/api/uploadbox/Remove" ChunkSize="500000"></UploaderAsyncSettings> </SfUploader>
<SfButton CssClass="e-button" OnClick="OnButtonClick">Convert</SfButton>
@code{ SfUploader UploadObj; public int count { get; set; } public List<FileInfo> Files = new List<FileInfo>() {};
public async Task OnButtonClick() { Files = await UploadObj.GetFilesData(); count = Files.Count; } } |
Find the sample for get list of uploaded files on Blazor File upload from here.
How can i assign the file(image) path to variables?
lets say I have 3 variables
image1, image2 and image3
I want the user to be able to select and upload max of 3 images
if the user selects only one image and uploads, I want its URL to be given to image1
if the user selects and uploads two or three images
I want the URLs of those 2 or 3 images to be given to image1, image2 and image3 respectively
You can refer to the below Syncfusion blog for your requirement.
Also, you can get the data of the selected files in the FileSelected event. Please refer to the below documentation for more information.
https://blazor.syncfusion.com/documentation/file-upload/events#fileselected