Using the new Angular 4.3 HttpClient, how can I upload and access files in an ASP.NET Core 2.0 Controller while reporting upload progress to the client?
ASP.NET Core 2.0 and Angular 4.3 File Upload with progress
6.4k Views Asked by Matthew Steven Monkan At
2
There are 2 best solutions below
0
argoth
On
You could use the interface Microsoft.AspNetCore.Http.IFormFile that represents a file sent with the HttpRequest to simplify the access to file.
[HttpPost, DisableRequestSizeLimit, Route("api/files")]
public async Task UploadFiles(IFormFile file){
//your file stream
var stream = file.OpenReadStream();
}
Related Questions in ANGULAR
- Is it possible to use ES5 JavaScript with Angular 2 instead of TypeScript?
- Module '"angular2/angular2"' has no exported member 'For'
- import syntax in typescript creating another js file in visual studio
- Separate ts file for imports
- How to use an AngularJS 2 component multiple times in the same page?
- injectables not working in angular 2.0 latest build 26
- Does angular2 bootstrap have a way to dynamically target elements like it does in angular 1.x
- Import {} from location is not found in VS Code using TypeScript and Angular 2
- Angular 2/Typescript: require not found
- ng-switch in Angular2
- Angular 2 import issue: "Zone already exported on window the object!"
- How to make FileReader work with Angular2?
- Writing the most basic Unit test in Angular 2?
- Angular2: Creating child components programmatically
- AngularJS - TypeError: Cannot read property 'canonicalUrl' of undefined
Related Questions in ASP.NET-CORE
- ASP.NET 5 Class Library - Nuget package Web.Config transform
- Asp.Net 5 correct way to access logging config file from Startup.cs
- What is the difference between 'dependencies' and 'frameworkAssemblies' in project.json?
- Getting absolute URLs using ASP.NET Core
- How to add Project Reference in asp.net 5 application
- Configure the authorization server endpoint
- Observer for fire&forget Task
- IApplicationBuilder exists in both Microsoft.AspNet.Http.Abstractions and Microsoft.AspNet.Http
- What frameworks are available in ASP.NET Core (ASP.NET 5) applications?
- How do I include 'System.Runtime.Serialization.Json' namespace in my VSCode project on Mac OS X?
- How to suppress warnings when building an ASP.NET 5 project?
- Dependency Injection in asp.net 5 custom classes, what is the correct way?
- How to access IConfiguration property from Controller in ASP.NET 5
- Getting a scoped component from a IDocumentStoreListener
- How is execution passed from the clr to Startup class (startup.cs)?
Related Questions in ASP.NET-CORE-2.0
- Is possible to use third-party .dll (.Net Framework 2.0) with ASP.Net Core 2.0 project?
- Why is ASP.NET Core Identity 2.0 Authorize filter causing me to get a 404?
- How to Add an implementation of 'IDesignTimeDbContextFactory<DataContext>' to the project in asp.net-core-2.0
- Generating Roles in Startup.cs doesn't work anymore in .NET Core 2.0
- not getting any error when serilog is not able to insert data in sql server
- Can i use razor base web application in asp.net core 2.0.0 for authorization?
- The version of Microsoft.NET.Sdk used by this project is insufficient to support references to libraries targeting .NET Standard 1.5 or higher
- Token Based Authentication on Postman
- Can an ASP.NET Core 2.0 project be created without a Microsoft.AspNetCore.All package?
- How to use a razor page string variable in javascript? - show alert with C# string
- Can I use Bluemix Cloud Foundry Apps with dotnet core 2?
- Converting DataTable to JSON in ASP Core 2
- Nlog Error when writing to database, what is the correct config for Nlog in asp core 2?
- AspNet Core CookieAuthentication with injected SessionStore
- How do I get the claims from an openid access token in asp.net core?
Related Questions in ANGULAR4-HTTPCLIENT
- Default and specific request timeout
- Angular 4 : Send custom headers with http requests
- CORS Error in Angular 4 map function through php
- How to add a custom interceptor to angular 4 app in bootstrap
- NGRX 4 effects with angular 4.3 httpClient
- Angular 4 And Node js
- Angular 4 get method not able to fetch data
- Angular4 migrate from Http to HttpClient
- How To Display Data Using Angular 4 Interceptors
- Interceptors only for specific Service
- Http Get Response Updates HTML but giving undefined error in console
- Angular 4.2.x interceptor is not being executed
- ASP.NET Core 2.0 and Angular 4.3 File Upload with progress
- Angular 4: Inject service having @angular/http as dependency in non-component class
- Error facing on communication between asp.net webapi server and angular2 application
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Here is a working example to get started:
HTML
TypeScript
Controller