48 lines
1.3 KiB
Plaintext
48 lines
1.3 KiB
Plaintext
@page "/fileupload2"
|
|
@using System.Linq
|
|
@using System.Net.Http.Headers
|
|
@using System.Text.Json
|
|
@using Microsoft.Extensions.Logging
|
|
@inject IHttpClientFactory ClientFactory
|
|
|
|
<h1>Upload Files</h1>
|
|
|
|
<p>
|
|
<label>
|
|
Upload up to @maxAllowedFiles files:
|
|
<InputFile OnChange="@OnInputFileChange" multiple />
|
|
</label>
|
|
</p>
|
|
|
|
@if (files.Count > 0)
|
|
{
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<ul>
|
|
@foreach (var file in files)
|
|
{
|
|
<li>
|
|
File: @file.Name
|
|
<br>
|
|
@if (FileUpload(uploadResults, file.Name, Logger,
|
|
out var result))
|
|
{
|
|
<span>
|
|
Stored File Name: @result.StoredFileName
|
|
</span>
|
|
}
|
|
else
|
|
{
|
|
<span>
|
|
There was an error uploading the file
|
|
(Error: @result.ErrorCode).
|
|
</span>
|
|
}
|
|
</li>
|
|
}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
}
|
|
|