mirror of
https://github.com/radzenhq/radzen-blazor.git
synced 2026-07-08 18:16:08 +00:00
The Upload component demo was served at /example-upload because the demo host's UploadController owned the /upload URL space. Move the controller's endpoints under api/upload/* to free /upload, point the demo page and every consumer (Upload and HtmlEditor demos) at the new paths, switch the page route and ExampleService path to /upload, and add a permanent 301 redirect from /example-upload (and the legacy docs URL) to /upload.
31 lines
991 B
Plaintext
31 lines
991 B
Plaintext
<RadzenCard Variant="Variant.Outlined">
|
|
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Select a file to upload and click Upload</RadzenText>
|
|
<RadzenUpload @ref="upload" Auto="false" Multiple="true" Url="api/upload/multiple" InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", "select file" }})"
|
|
Progress=@OnProgress Style="width: 100%" />
|
|
<RadzenButton Text="Upload" Click=@OnUpload class="rz-mt-4" />
|
|
</RadzenCard>
|
|
|
|
<EventConsole @ref=@console />
|
|
|
|
@code {
|
|
EventConsole console;
|
|
RadzenUpload upload;
|
|
|
|
void OnUpload()
|
|
{
|
|
upload.Upload();
|
|
}
|
|
|
|
void OnProgress(UploadProgressArgs args)
|
|
{
|
|
console.Log($"Upload progress: {args.Progress}% / {args.Loaded} of {args.Total} bytes.");
|
|
|
|
if (args.Progress == 100)
|
|
{
|
|
foreach (var file in args.Files)
|
|
{
|
|
console.Log($"Uploaded: {file.Name} / {file.Size} bytes");
|
|
}
|
|
}
|
|
}
|
|
} |