<FluentInputFile DragDropZoneVisible="false" Mode="InputFileMode.Buffer" MaximumFileSize=10485760 BufferSize="10485760" Multiple="false" AnchorId="MyUploadButton" Accept=".jpg,.doc,.docx,.pdf,.jpeg,.gif" OnCompleted="@OnCompletedAsync" />https://www.fluentui-blazor.net/InputFileI’m using the FluentInputFile component to upload files and save the data from file.Buffer.Data to a file on a SharePoint site(the SharePoint API requires the file content in byte array format). However, I’m unable to open the file because it appears to be damaged. I also tried saving file.Buffer.Data to a local file, but I was still unable to open it. Here’s the code I used to save it locally.
private async Task OnCompletedAsync(IEnumerable<FluentInputFileEventArgs> files) { var buffer = new byte[file.Size]; buffer = file.Buffer.Data; car path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", file.Name); System.IO.File.WriteAllBytes(path, buffer); }