BlazorInputFile icon indicating copy to clipboard operation
BlazorInputFile copied to clipboard

SharedMemoryFileListEntryStream.ReadAsync() does not return requested bytes

Open mark-at-tusksoft opened this issue 5 years ago • 0 comments

Relevant info: Blazor-Client WASM app, hosted with asp.net core using identity

I think this may be more of a documentation issue. When calling ReadAsync() on the stream returned by BlazorFileInput OnChange event, I typically never get the number of bytes requested. (i.e. I specify it to read 2MB, it only fills my 2MB buffer with 1MB worth of data). It correctly reports the number of bytes it actually read, but I didn't think that it would consistently under-fill the buffer when there was more data remaining than the buffer size.

I was having a bear of a time wondering why my Azure BlockBlobs were getting uploaded with 5-100% additional size. Don't be careless like me, check the bytes being read and update your buffer accordingly!

mark-at-tusksoft avatar Aug 06 '20 00:08 mark-at-tusksoft