-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
Request Streaming upload #33693
base: main
Are you sure you want to change the base?
Request Streaming upload #33693
Conversation
@pavelsavara ... Do you know if dotnet/runtime#91699 has made it into the latest SDK that I think I can get, which is I'm still hitting the out of memory error with large file uploads using our published example code under the public RC1 release ( |
It should be there. Which sample code ? |
This ... There are two spots that we'll need coverage ...
|
UPDATE: Nevermind on that! I have the code generally working, so I'll float what I have on the PR for review. I also have a side question WRT the |
Something like below will enable that for Chrome/Edge.
|
So, you're saying that we'll have to move away from an The reason that I thought the code wouldn't need to change is that I thought the inner workings of I have a local test environment here for this. I'll refactor it into an |
Can't I just do it this way? ... var req = new HttpRequestMessage(HttpMethod.Post, "/Filesave");
req.SetBrowserRequestStreamingEnabled(true); |
My point was to use the |
Latest code is ... var req = new HttpRequestMessage(HttpMethod.Post, "/Filesave");
req.SetBrowserRequestStreamingEnabled(true);
req.Version = HttpVersion.Version20;
req.Content = content;
var response = await Http.SendAsync(req); Works for small files, but for a 1 GB file, I'm getting a Kestrel(?) exception ...
|
That's actually server side error. Try setting MaxRequestBodySize on your server |
|
I hit another limit on the server ...
I'll see about extending that one. |
@danroth27 @mkArtakMSFT @pavelsavara @maraf ... See the NOTES that I just added to the opening comment ☝️. This is ready for a look and discussion on next steps. |
Fixes #33692
Fixes #33850 ... Adds a Security considerations section with two subsections: One is on avoiding
IBrowserFile.Size
for file size limits. The other is on not using a client-supplied file name for saving a file to physical storage.Notes ...
BIG ❓...
My understanding is that request streaming gracefully degrades when any of the following conditions fail:
However ...
For a Safari/FF user and a large file upload, this current guidance is going to 💥. We could take any of the following approaches ...
For 2 or 3 ☝️, tell me if checking the user agent via JS interop is the right way to go. I mean there's nothing else available via API that I can check to determine if it's a non-Chromium browser, correct?
If we're going with showing an HTTP Ranges fallback, my 🦖 hacks with
MultipartContent("byteranges", "...");
didn't really result in a working demo. It is best if a PU engineer provide a fully-working client-server example of the HTTP Ranges approach.... and one more related ❓ ...
This is CSR right now for the BWA side ... Interactive WASM ... no
IsBrowser
check and no alternative processing required in this section/demo. Up to this point, I was just trying to get it working in the CSR case for the CSR section. I haven't delved into Auto rendering yet. Do you want to get into the weeds with the Auto scenario (i.e., alternative services for server versus client), or do you want to wait and think about that later?Internal previews