about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/FileUploadTest.razor
blob: 2e25b5444035fa40a5daf22635bb6249cb11d05e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
@page "/FileUploadTest"
<h3>FileUploadTest</h3>

<InputFile OnChange="FilePicked" multiple="false"></InputFile>


@code {

    private async void FilePicked(InputFileChangeEventArgs obj)
    {
        Console.WriteLine("FilePicked");
        Console.WriteLine(obj.File.Name);
        Console.WriteLine(obj.File.Size);
        Console.WriteLine(obj.File.ContentType);
        var res = await RuntimeCache.CurrentHomeServer.UploadFile(obj.File.Name, obj.File.OpenReadStream(), obj.File.ContentType);
        Console.WriteLine(res);
    }

}