Open sgerendasy opened 4 years ago
I am experiencing the same issue with just 1
Confirm. it hangs when i press another upload after all previous uploads have finished.
do a ms.Dispose() as last statement
Thank you @RealHabix, ms.Dispose() did the trick.
In the usage information blog post there is an example of a multiple file upload with this source code. In the blog post there is a gif demonstration which shows three files being asynchronously copied to a MemoryStream.
If you begin each copy to MemoryStream before any other files finish copying, this process works fine. However, if you call
await file.Data.CopyToAsync(ms)
after any other file has finished copying to MemoryStream, the copy hangs after getting ~500kB copied.You can verify this by cloning the repo and running the sample program with the MultiFile.razor page. Select two or more files to upload, then click the Load button on one of them. Wait until that file is 100% loaded. Then click Load on another file. It will hang.
This is a problem for me because I have a form where 3 different files get selected, using 3 different
<InputFile>
components. The files begin uploading as soon as their selected, which involves reading the Stream infile.Data
. If the user selects a 2nd or 3rd file after a file has finished uploading the newly selected file fails to upload. The program simply hangs.I have been using files that are 3-50MB in size, which is what I expect the file size range to be in production.