removed old upload page, ups
This commit is contained in:
parent
13a77b0d60
commit
08664bf1ea
|
@ -1,33 +0,0 @@
|
||||||
@page "/upload"
|
|
||||||
|
|
||||||
@using Microsoft.AspNetCore.Authorization
|
|
||||||
@using Wave.Services
|
|
||||||
|
|
||||||
@attribute [Authorize]
|
|
||||||
@rendermode InteractiveServer
|
|
||||||
@inject ImageService ImageService
|
|
||||||
|
|
||||||
<PageTitle>Upload</PageTitle>
|
|
||||||
|
|
||||||
<h3 class="title mb-3">Upload</h3>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
@if (Path is not null) {
|
|
||||||
<img src="@Path" type="@ImageService.ImageMimeType" width="800" alt="" />
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<FileUploadComponent FileUploadedCallback="Callback" />
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private string? Path { get; set; }
|
|
||||||
|
|
||||||
private async Task Callback(string tempFilePath) {
|
|
||||||
var guid = await ImageService.StoreImageAsync(tempFilePath);
|
|
||||||
if (guid is null) {
|
|
||||||
throw new ApplicationException("Could not process file, upload possibly corrupted.");
|
|
||||||
}
|
|
||||||
|
|
||||||
Path = "/images/" + guid;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in a new issue