Comments (3)
Check RadzenFileUpload. It supports that already.
from radzen-blazor.
maybe I'm missing something super obvious but the existing one only seems to support a single file and requires binding individual properties for file name and file size:
/// <summary>
/// Gets or sets the image file name.
/// </summary>
/// <value>The image file name.</value>
[Parameter]
public string FileName { get; set; }
/// <summary>
/// Gets or sets the FileName changed.
/// </summary>
/// <value>The FileName changed.</value>
[Parameter]
public EventCallback<string> FileNameChanged { get; set; }
/// <summary>
/// Gets or sets the image file size.
/// </summary>
/// <value>The image file size.</value>
[Parameter]
public long? FileSize { get; set; }
/// <summary>
/// Gets or sets the FileSize changed.
/// </summary>
/// <value>The FileSize changed.</value>
[Parameter]
public EventCallback<long?> FileSizeChanged { get; set; }
wouldn't it be more flexible and generic to have the value as List<IBrowserFile> Value
and enable support to toggle multiple file selection? the existing implementation seems to be pretty hardcoded to a single file I've tried this in the examples on the docs page and it doesn't pick up the multiple selected files when I try:
@using RadzenBlazorDemos.Data
@using RadzenBlazorDemos.Models.Northwind
@inherits DbContextPage
<div class="container-fluid">
<div class="row px-3">
<div class="col-lg-6 offset-lg-3 p-3">
<RadzenCard>
<RadzenFileInput @bind-Value=@files TValue="List<IBrowserFile>" class="w-100"
Change=@OnChange Error=@(args => OnError(args, "FileInput")) InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", "select file" }, { "multiple", true }})"/>
</RadzenCard>
</div>
</div>
</div>
<EventConsole @ref=@console />
@code {
List<IBrowserFile> files = new ();
EventConsole console;
string fileName;
long? fileSize;
void OnChange(List<IBrowserFile> value)
{
console.Log($"value: {value?.ToString()} files: {files?.ToString()}");
console.Log($"value: {value?.Count} files: {files?.Count}");
}
void OnError(UploadErrorEventArgs args, string name)
{
console.Log($"{args.Message}");
}
}
from radzen-blazor.
Check the online demos for RadzenFileUpload (the client-side upload).
from radzen-blazor.
Related Issues (20)
- Radzen Datagrid not using object's overridden GetHashCode() method HOT 2
- Accessiblity HOT 4
- Add CharacterPattern to a textBox HOT 4
- Wrong logic in GetStyles method in RadzenDataGridColumn.razor.cs HOT 1
- ColumnChart Series shows triangles HOT 1
- Use PackageLicenseExpression instead of PackageLicenseFile HOT 1
- Right sidebar does not show on smaller screens and ignores Responsive attribute HOT 3
- tree-file-system sample fails, problem with new Checkable delegate
- RadzenDataGrid: Column width does not reset when using Reset method or clearing saved settings HOT 5
- Splitbutton Click nulllability issues with RadzenSplitButtonItem HOT 3
- Allow custom event onkeydown handlers for all input components HOT 2
- Dialog tab order HOT 4
- DataGrid "Simple Filter Mode with Menu" header styling proposal HOT 1
- How to submit contribution (DataAnnotionValidator) HOT 1
- Dropdown filtering korean characters issue HOT 1
- Datagrid Composite Columns sizing bug HOT 2
- Change visibility modifier for getSortIndex and SaveSettings in RadzenDataGrid
- Incorrect cursor display when changing column width in RadzenDataGrid HOT 1
- DataGrid EnumFilterTranslationFunc not applied to second filter
- Double component parameter names should be allow with additional properties HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from radzen-blazor.