Hey, i am following the example listed here Blazor FileSelect - Events | Telerik UI for Blazor to use the FileSelect in my project to allow users to upload files in a blazor server all.
I'm using the code below to save the files to a network location.
private async Task UploadFile(FileSelectFileInfo file) { var path = Path.Combine(HostingEnvironment?.WebRootPath, file.Name); await using FileStream fs = new FileStream(path, FileMode.Create); await file.Stream.CopyToAsync(fs); }
file.Stream.CopyTo(fs);
Eric, the PDF file type should not be related in this case. I just tested the scenario from the linked documentation and it works.
Seek the problem elsewhere, for example in the file size, file name, or anything that can cause an exception, because the code does not expect something to happen.