removed old upload page, ups

This commit is contained in:
Mia Rose Winter 2024-01-21 22:45:46 +01:00
parent 13a77b0d60
commit 08664bf1ea
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E

View file

@ -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;
}
}