Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Net6P7: Blazor WASM can't upload large files (500MB, 1GB, 2GB) #35899

Closed
StefanOssendorf opened this issue Aug 28, 2021 · 8 comments
Closed

Net6P7: Blazor WASM can't upload large files (500MB, 1GB, 2GB) #35899

StefanOssendorf opened this issue Aug 28, 2021 · 8 comments
Labels
area-blazor Includes: Blazor, Razor Components External This is an issue in a component not contained in this repository. It is open for tracking purposes. feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. question Status: Resolved

Comments

@StefanOssendorf
Copy link

Describe the bug

I can not upload a file of size 500MB, 1GB or 2GB from a blazor WASM app to my asp.net core web api server.
According to this statement from Daniel Roth it should be possible.

To Reproduce

I have created a minimal working example here on githuib: Large file can't be uploaded. The code is based on this from the documentation.
I have tested with 500MB, 1GB and 2GB files. I did not add the files to the repo but I can if that is desired.
I created my test files with the following powershell commands:
fsutil file createnew Dummy500MB.pdf 524288000
fsutil file createnew Dummy1GB.pdf 1073741824
fsutil file createnew Dummy2GB.pdf 2147483648

Exceptions (if any)

I have added all browser logs in the "Exceptionlogs" folder in the above linked repo in full detail.
Exception in Edge Version 92.0.902.84 (Offizielles Build) (64-Bit)
500MB:

POST http://localhost:5000/Filesave net::ERR_CONNECTION_RESET
--
blazor.webassembly.js:1 Uncaught (in promise) Error: System.Net.Http.HttpRequestException: TypeError: Failed to fetch
 ---> System.Runtime.InteropServices.JavaScript.JSException: TypeError: Failed to fetch
   at System.Net.Http.BrowserHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in System.Net.Http.dll:token 0x6000376+0x58e
   --- End of inner exception stack trace ---
   at System.Net.Http.BrowserHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in System.Net.Http.dll:token 0x6000376+0x7a9
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken) in System.Net.Http.dll:token 0x600013b+0x1b7
   at MWE_WASM_App.Client.Pages.FileUpload2.OnInputFileChange(InputFileChangeEventArgs e) in e:\Programming\Github\MWE-Net6P7-WASMLargeFileUploadFails\MWE-WASM-App\Client\Pages\FileUpload2.razor:line 101
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task) in Microsoft.AspNetCore.Components.dll:token 0x60000a5+0x7e
    at Object.endInvokeDotNetFromJS (http://localhost:5000/_framework/blazor.webassembly.js:1:3473)
    at Object.dt [as endInvokeDotNetFromJS] (http://localhost:5000/_framework/blazor.webassembly.js:1:54645)
    at Object.ut [as invokeJSFromDotNet] (http://localhost:5000/_framework/blazor.webassembly.js:1:54177)
    at _mono_wasm_invoke_js_blazor (http://localhost:5000/_framework/dotnet.6.0.0-preview.7.21377.19.js:1:191287)
    at <anonymous>:wasm-function[2545]:0x7e724
    at <anonymous>:wasm-function[2270]:0x66a5e
    at <anonymous>:wasm-function[6847]:0x168e10
    at <anonymous>:wasm-function[6664]:0x160079
    at <anonymous>:wasm-function[3456]:0xaca88
    at <anonymous>:wasm-function[666]:0x1595d

1GB

Uncaught (in promise) Error: System.OutOfMemoryException: Out of memory
   at System.IO.MemoryStream.set_Capacity(Int32 value) in System.Private.CoreLib.dll:token 0x60058b3+0x51
   at System.IO.MemoryStream.EnsureCapacity(Int32 value) in System.Private.CoreLib.dll:token 0x60058a9+0x55
   at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count) in System.Private.CoreLib.dll:token 0x60058c1+0x4d
   at System.Net.Http.HttpContent.LimitMemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count) in System.Net.Http.dll:token 0x60001b2+0x7
   at System.IO.MemoryStream.WriteAsync(ReadOnlyMemory`1 buffer, CancellationToken cancellationToken) in System.Private.CoreLib.dll:token 0x60058c4+0x1b
--- End of stack trace from previous location ---
   at System.IO.Stream.<CopyToAsync>g__Core|29_0(Stream source, Stream destination, Int32 bufferSize, CancellationToken cancellationToken) in System.Private.CoreLib.dll:token 0x600560e+0xaa
   at System.Net.Http.StreamToStreamCopy.<CopyAsync>g__DisposeSourceAsync|1_0(Task copyTask, Stream source) in System.Net.Http.dll:token 0x60002dd+0x64
   at System.Net.Http.HttpContent.<CopyToAsync>g__WaitAsync|56_0(ValueTask copyTask) in System.Net.Http.dll:token 0x60001af+0x67
   at System.Net.Http.MultipartContent.SerializeToStreamAsyncCore(Stream stream, TransportContext context, CancellationToken cancellationToken) in System.Net.Http.dll:token 0x6000280+0x2e7
   at System.Net.Http.HttpContent.LoadIntoBufferAsyncCore(Task serializeToStreamTask, MemoryStream tempBuffer) in System.Net.Http.dll:token 0x6000199+0x99
   at System.Net.Http.HttpContent.<WaitAndReturnAsync>d__82`2[[System.Net.Http.HttpContent, System.Net.Http, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.Byte[], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext() in System.Net.Http.dll:token 0x60001db+0x64
   at System.Net.Http.BrowserHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in System.Net.Http.dll:token 0x6000376+0x241
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken) in System.Net.Http.dll:token 0x600013b+0x1b7
   at MWE_WASM_App.Client.Pages.FileUpload2.OnInputFileChange(InputFileChangeEventArgs e) in e:\Programming\Github\MWE-Net6P7-WASMLargeFileUploadFails\MWE-WASM-App\Client\Pages\FileUpload2.razor:line 101
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task) in Microsoft.AspNetCore.Components.dll:token 0x60000a5+0x7e
    at Object.endInvokeDotNetFromJS (http://localhost:5000/_framework/blazor.webassembly.js:1:3473)
    at Object.dt [as endInvokeDotNetFromJS] (http://localhost:5000/_framework/blazor.webassembly.js:1:54645)
    at Object.ut [as invokeJSFromDotNet] (http://localhost:5000/_framework/blazor.webassembly.js:1:54177)
    at _mono_wasm_invoke_js_blazor (http://localhost:5000/_framework/dotnet.6.0.0-preview.7.21377.19.js:1:191287)
    at <anonymous>:wasm-function[2545]:0x7e724
    at <anonymous>:wasm-function[2270]:0x66a5e
    at <anonymous>:wasm-function[6847]:0x168e10
    at <anonymous>:wasm-function[6664]:0x160079
    at <anonymous>:wasm-function[3456]:0xaca88
    at <anonymous>:wasm-function[666]:0x1595d

Firefox 91.0.2 (64-Bit)
500MB:

Uncaught (in promise) Error: System.OutOfMemoryException: Out of memory
   at System.GC.AllocateArray[Byte](Int32 length, Boolean pinned) in System.Private.CoreLib.dll:token 0x60002f9+0x2f
   at System.GC.AllocateUninitializedArray[Byte](Int32 length, Boolean pinned) in System.Private.CoreLib.dll:token 0x60002f8+0x0
   at System.IO.MemoryStream.ToArray() in System.Private.CoreLib.dll:token 0x60058c0+0x17
   at System.Net.Http.HttpContent.ReadBufferedContentAsByteArray() in System.Net.Http.dll:token 0x6000185+0x0
   at System.Net.Http.HttpContent.<>c.<ReadAsByteArrayAsync>b__40_0(HttpContent s) in System.Net.Http.dll:token 0x60001d6+0x0
   at System.Net.Http.HttpContent.<WaitAndReturnAsync>d__82`2[[System.Net.Http.HttpContent, System.Net.Http, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.Byte[], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext() in System.Net.Http.dll:token 0x60001db+0x6b
   at System.Net.Http.BrowserHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in System.Net.Http.dll:token 0x6000376+0x241
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken) in System.Net.Http.dll:token 0x600013b+0x1b7
   at MWE_WASM_App.Client.Pages.FileUpload2.OnInputFileChange(InputFileChangeEventArgs e) in e:\Programming\Github\MWE-Net6P7-WASMLargeFileUploadFails\MWE-WASM-App\Client\Pages\FileUpload2.razor:line 101
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task) in Microsoft.AspNetCore.Components.dll:token 0x60000a5+0x7e

1GB:

Uncaught (in promise) Error: System.OutOfMemoryException: Out of memory
   at System.IO.MemoryStream.set_Capacity(Int32 value) in System.Private.CoreLib.dll:token 0x60058b3+0x51
   at System.IO.MemoryStream.EnsureCapacity(Int32 value) in System.Private.CoreLib.dll:token 0x60058a9+0x55
   at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count) in System.Private.CoreLib.dll:token 0x60058c1+0x4d
   at System.Net.Http.HttpContent.LimitMemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count) in System.Net.Http.dll:token 0x60001b2+0x7
   at System.IO.MemoryStream.WriteAsync(ReadOnlyMemory`1 buffer, CancellationToken cancellationToken) in System.Private.CoreLib.dll:token 0x60058c4+0x1b
--- End of stack trace from previous location ---
   at System.IO.Stream.<CopyToAsync>g__Core|29_0(Stream source, Stream destination, Int32 bufferSize, CancellationToken cancellationToken) in System.Private.CoreLib.dll:token 0x600560e+0xac
   at System.Net.Http.StreamToStreamCopy.<CopyAsync>g__DisposeSourceAsync|1_0(Task copyTask, Stream source) in System.Net.Http.dll:token 0x60002dd+0x64
   at System.Net.Http.HttpContent.<CopyToAsync>g__WaitAsync|56_0(ValueTask copyTask) in System.Net.Http.dll:token 0x60001af+0x69
   at System.Net.Http.MultipartContent.SerializeToStreamAsyncCore(Stream stream, TransportContext context, CancellationToken cancellationToken) in System.Net.Http.dll:token 0x6000280+0x2e7
   at System.Net.Http.HttpContent.LoadIntoBufferAsyncCore(Task serializeToStreamTask, MemoryStream tempBuffer) in System.Net.Http.dll:token 0x6000199+0x99
   at System.Net.Http.HttpContent.<WaitAndReturnAsync>d__82`2[[System.Net.Http.HttpContent, System.Net.Http, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.Byte[], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext() in System.Net.Http.dll:token 0x60001db+0x64
   at System.Net.Http.BrowserHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in System.Net.Http.dll:token 0x6000376+0x241
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken) in System.Net.Http.dll:token 0x600013b+0x1b7
   at MWE_WASM_App.Client.Pages.FileUpload2.OnInputFileChange(InputFileChangeEventArgs e) in e:\Programming\Github\MWE-Net6P7-WASMLargeFileUploadFails\MWE-WASM-App\Client\Pages\FileUpload2.razor:line 101
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task) in Microsoft.AspNetCore.Components.dll:token 0x60000a5+0x7e

Further technical details

  • ASP.NET Core version: .Net 6 Preview 7
  • Include the output of dotnet --info
    .NET SDK (gemäß "global.json"):
    Version: 6.0.100-preview.7.21379.14
    Commit: 22d70b47bc

Laufzeitumgebung:
OS Name: Windows
OS Version: 10.0.19043
OS Platform: Windows
RID: win10-x64
Base Path: c:\program files\dotnet\sdk\6.0.100-preview.7.21379.14\

Host (useful for support):
Version: 6.0.0-preview.7.21377.19
Commit: 91ba01788d

.NET SDKs installed:
1.0.0-preview2-003131 [c:\program files\dotnet\sdk]
1.0.0 [c:\program files\dotnet\sdk]
1.0.2 [c:\program files\dotnet\sdk]
1.0.3 [c:\program files\dotnet\sdk]
1.0.4 [c:\program files\dotnet\sdk]
1.1.0 [c:\program files\dotnet\sdk]
2.0.0 [c:\program files\dotnet\sdk]
2.0.2-vspre-006949 [c:\program files\dotnet\sdk]
2.0.2 [c:\program files\dotnet\sdk]
2.0.3 [c:\program files\dotnet\sdk]
2.1.2 [c:\program files\dotnet\sdk]
2.1.4 [c:\program files\dotnet\sdk]
2.1.100-preview-007363 [c:\program files\dotnet\sdk]
2.1.100 [c:\program files\dotnet\sdk]
2.1.101 [c:\program files\dotnet\sdk]
2.1.103 [c:\program files\dotnet\sdk]
2.1.104 [c:\program files\dotnet\sdk]
2.1.200-preview-007517 [c:\program files\dotnet\sdk]
2.1.200 [c:\program files\dotnet\sdk]
2.1.201 [c:\program files\dotnet\sdk]
2.1.202 [c:\program files\dotnet\sdk]
2.1.301 [c:\program files\dotnet\sdk]
2.1.400 [c:\program files\dotnet\sdk]
2.1.401 [c:\program files\dotnet\sdk]
2.1.402 [c:\program files\dotnet\sdk]
2.1.403 [c:\program files\dotnet\sdk]
2.1.526 [c:\program files\dotnet\sdk]
2.1.600-preview-009472 [c:\program files\dotnet\sdk]
2.1.600-preview-009497 [c:\program files\dotnet\sdk]
2.1.600 [c:\program files\dotnet\sdk]
2.1.601 [c:\program files\dotnet\sdk]
2.1.617 [c:\program files\dotnet\sdk]
2.1.700-preview-009601 [c:\program files\dotnet\sdk]
2.1.700 [c:\program files\dotnet\sdk]
2.1.701 [c:\program files\dotnet\sdk]
2.1.800-preview-009677 [c:\program files\dotnet\sdk]
2.1.800-preview-009696 [c:\program files\dotnet\sdk]
2.1.800 [c:\program files\dotnet\sdk]
2.1.818 [c:\program files\dotnet\sdk]
3.0.100-preview6-012264 [c:\program files\dotnet\sdk]
3.1.412 [c:\program files\dotnet\sdk]
5.0.104 [c:\program files\dotnet\sdk]
5.0.206 [c:\program files\dotnet\sdk]
5.0.303 [c:\program files\dotnet\sdk]
5.0.400 [c:\program files\dotnet\sdk]
6.0.100-preview.5.21302.13 [c:\program files\dotnet\sdk]
6.0.100-preview.6.21355.2 [c:\program files\dotnet\sdk]
6.0.100-preview.7.21379.14 [c:\program files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.1 [c:\program files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.2 [c:\program files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.4 [c:\program files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.5 [c:\program files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.7 [c:\program files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.8 [c:\program files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.9 [c:\program files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.11 [c:\program files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.12 [c:\program files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.13 [c:\program files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.24 [c:\program files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.29 [c:\program files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.30 [c:\program files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.1 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.2 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.4 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.5 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.7 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.8 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.9 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.11 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.12 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.13 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.24 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.29 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.30 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0-preview6.19307.2 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.18 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.4 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.9 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-preview.5.21301.17 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-preview.6.21355.2 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-preview.7.21378.6 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.1 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.0.4 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.0.5 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.1 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.2 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.0 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.3 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.5 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.6 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.7 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.9 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.1 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.2 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.3-servicing-26724-03 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.4 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.5 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.7 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.8 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.9 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.11 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.12 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.13 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.24 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.29 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.30 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0-preview6-27804-01 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.4 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.18 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.4 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.9 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-preview.5.21301.5 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-preview.6.21352.12 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-preview.7.21377.19 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0-preview6-27804-01 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.4 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.18 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.4 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.9 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-preview.5.21301.4 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-preview.6.21353.1 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-preview.7.21378.9 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App]

  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version
    Microsoft Visual Studio Community 2022 Preview (64-bit)
    Version 17.0.0 Preview 3.1
@davidfowl
Copy link
Member

davidfowl commented Aug 29, 2021

Seems like a problem with https://github.com/dotnet/runtime/blob/cffaa78235ea93d5e3eeb56956579df503e11250/src/libraries/System.Net.Http/src/System/Net/Http/BrowserHttpHandler/BrowserHttpHandler.cs#L191-L194. We read the content into a single JavaScript array buffer. I'm not sure there's much we can do about this until fetch supports upload streaming https://web.dev/fetch-upload-streaming/

cc @lewing

@campersau
Copy link
Contributor

Tracking issue: dotnet/runtime#36634

@StefanOssendorf
Copy link
Author

Thanks for your answers but what does that mean exactly?
Is the statement from Net 6 Preview 7 Announcement Blazor can handle large file uploads (>2GB) wrong or only applies for Server-Side?

Thanks in advance

@javiercn javiercn added area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly External This is an issue in a component not contained in this repository. It is open for tracking purposes. labels Aug 30, 2021
@javiercn
Copy link
Member

@StefanOssendorf It applies to the InputFile component specifically.

Which in the wasm case just marshals the data from JS to C# (which on the SSB goes across the network).

If you have a large file upload request, I suggest you try and implement that using Http Ranges, not only will avoid this problem all-together, it will also be more reliable allowing you to avoid re-uploading entire files upon a failure (you would need to update only the missing chunk instead)

@javiercn javiercn added ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. question labels Aug 30, 2021
@ghost ghost added the Status: Resolved label Aug 30, 2021
@StefanOssendorf
Copy link
Author

@javiercn Thank you for your answer.

Do you happen to have an example/information for the chunked upload? A pointer to something where this is done with an asp.net controller would be awesome since I have no experience in doing that 😅.

Thanks in advance.

@javiercn
Copy link
Member

@StefanOssendorf I don't have specific samples, I'm merely suggesting how I would go about it.

@StefanOssendorf
Copy link
Author

Ah okay. Thank you anyway :-)

Should I close this now?

@ghost
Copy link

ghost commented Aug 31, 2021

This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.

See our Issue Management Policies for more information.

@ghost ghost closed this as completed Aug 31, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Sep 30, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components External This is an issue in a component not contained in this repository. It is open for tracking purposes. feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. question Status: Resolved
Projects
None yet
Development

No branches or pull requests

4 participants