-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Comments
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 |
Tracking issue: dotnet/runtime#36634 |
Thanks for your answers but what does that mean exactly? Thanks in advance |
@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 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. |
@StefanOssendorf I don't have specific samples, I'm merely suggesting how I would go about it. |
Ah okay. Thank you anyway :-) Should I close this now? |
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. |
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:
1GB
Firefox 91.0.2 (64-Bit)
500MB:
1GB:
Further technical details
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]
Microsoft Visual Studio Community 2022 Preview (64-bit)
Version 17.0.0 Preview 3.1
The text was updated successfully, but these errors were encountered: