In the article 'File uploads in ASP.NET Core: Uploading large files with streaming',
The sample only covers the server side code, whilst the client code is only in JS.
Please provide an example that uses C# and .NET (preferably HttpClient) that interacts with the StreamingController.Upload action.
Just in case this issue and the other issue for this topic (broken sample) will be worked together, the xref for the broken sample issue is https://github.com/aspnet/Docs/issues/4777.
@weitzhandler you might try requesting the sample be written in the https://github.com/dotnet/docs
We're only writing samples that feature ASP.NET Core here.
Correct me if wrong; but @weitzhandler, were you referring to this bit: https://github.com/aspnet/Docs/blob/master/aspnetcore/mvc/models/file-uploads/sample/FileUploadSample/wwwroot/js/app.js#L38
demonstrates using JavaScript/Angular to stream to a controller action
@guardrex yes, that's what I was referring too.
Yeah it's pretty simple in HTML5 & JS because you hard code everything, but in .NET, since you want your code to be clean and use the dedicated wrappers around the various multipart sections and dispositions, you don't really know what exists and what doesn't and how to use it.
But as @Rick-Anderson said, I guess that's an issue for a different authority: https://github.com/dotnet/docs/issues/3916.
Anyway I already found it and it's in these classes:
MultipartFormDataContentContentDispositionHeaderValueThe classes that I didn't find matching values for, I just inherited from the above to extend them.
Copy from https://github.com/dotnet/docs/issues/3916
In the ASP.NET Core docs, the articles and samples about uploading files only involve web clients written in HTML and JS.
Please expand the .NET docs, so it includes some concrete examples on how to upload large files by streaming to a web API written in ASP.NET Core (or have the server pull).
@mairaw responds:
@Rick-Anderson @weitzhandler just so I understand. This request is not about ASP.NET Core functionality but a generic topic on how to upload files using classes under the System.Net.Http namespace?
@weitzhandler reply's:
@mairaw partially correct.
The main request is to have an article that walks us through the various HTTP header, content and disposition, accept, verb types and how they're represented in the .NET ecosystem.
The specific request that actually brought me here, would be the recommended way to upload large files to a server using streaming.
There is a multitude of ways to achieve this, and would be nice to know what's the recommended an most efficient from your perspective.
But it would also be beneficial to know how to accept those from an ASP.NET Core web API, some of this documentation already exists in your ASP.NET Core counterpart, but some would be nice to have. This will require some level of cooperation between you guys.
closed #5134
@Rick-Anderson what is the status of this? I have done something similar in the past and can provide some help if needed
@danroth27 can you comment on this?
There are other issues with the article.
Several references aren't mentioned in the page, and no link to the sample project exists in the article itself. Please fix this as well.
... and it's one of the old project.json-based samps in need of a refactor for 2.0.
Might be a good idea to itemize what needs to be done with this doc whether it is updating one or adding new ones.
Just as a reminder, would be very nice to have more client types covered, especially .NET client, presenting several HttpContent and stream/buffer types.
There should be an example for uploading really large files from a .NET client, optimized for speed, probably using PushStreamContent (which works fastest for me: 7s vs 22s using the example in the file with StreamContent).
Thanks for contacting us.
We don鈥檛 have the resources to invest in this area, so we are closing the issue. Should your request generate enough 馃憤 responses, we鈥檒l reconsider.
Thank you Rick.
Most helpful comment
Thanks for contacting us.
We don鈥檛 have the resources to invest in this area, so we are closing the issue. Should your request generate enough 馃憤 responses, we鈥檒l reconsider.