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 answers
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
- Firebase link existing user to anonymous account?
- It doesnt always show all the books on my homepage
- Google adsense ads.txt status cannot be not found
- When I navigate to the URL'http://localhost:4200/', it redirects me back
- Ionic Angular Standalone ion-icon are not showing at all
- How to make Angular understand that view child is of a specific type, not a general ElementRef?
- vscode, debug angular, first time, doesn't debug, 2nd time stops at main.js then it's ok
- How to perform CRUD operations on a static JSON array in Angular? (without API)
- Ngrx props<>() method in createAction()
- How to animate rotation of an image inside input control?
- Detecting click inside and outside of the listening component in Angular
- Angular - type guard not narrowing types
- In node_modules file i am getting Angular genric error while using fontawesome in angular12
- Angular 16 sending null values to API
- GoogleCloud Error: Not Found The requested URL was not found on this server
Related Questions in ASP.NET-CORE
- Windows environment variables at appsettings.json
- Which approach is right while creating a service for your update method?
- New Blazor Web App, Password Reset "A valid antiforgery token was not provided"
- No webpage was found for the web address: https://localhost:7002/Category/Add?area=Admin. Why is my URL generated like ?area=Admin instead of /Admin/
- how to get the html for a tag helper in code
- How to share authorization implemented in the server project with the client project in Blazor Web App Auto project?
- Why https is disabled on publish in .NET Core 7.0
- How to set language in a server-side rendering blazor app
- How can I debug server side rendering blazor code in a component?
- ASP.NET Core 6 randomly returning 200 with empty response
- ASP.NET Core MVC : NullReferenceException: Object reference not set to an instance of an object
- ASP.NET Core Identity Custom Register Endpoint
- VS Community 2022 cannot install dotnet-ef when i try to publish
- How does ASP.NET Core Identity ensure username is unique under concurrent conditions?
- In clean architecture, is the presentation layer allowed to communicate directly with the infrastructure layer?
Related Questions in ASP.NET-CORE-2.0
- Bulk Insert data from Excel to SQL database that contains foreign key
- Issue on migrating from .NET Core 2.2 to .NET 6
- Error 500 HTTP Request with body data length bigger than 100MB on C# API
- EntityMaterializerSource - Handling Datetime
- how to set the output type List<string> in a middleware in .NET Core 2.1?
- ASP.NET Core 2.0 set focus on a input element
- Find which target framework application is building on?
- .Net Core 2.1 Error 413 on multipart/form-data POST only on IIS not IIS Express
- How to modify web api to return message not matched when compare excel function return false?
- Authorize attribute is redirecting me to Login action even If I signed in successfully
- SqlDataAdapter.Fill is very slow with multiple result set
- ASP.NET Core 2.1 MVC - Not being able to set the cookie received from the web api response
- Routing edit/id in asp.net core application with angular not working
- How to get Windows loggedin username in IIS defind anonymous + windows authentication
- How to get Antiforgery token before sending response?
Related Questions in ANGULAR4-HTTPCLIENT
- How to read/save HTTP Post response (HTML format) in angular 4
- i want to add credentials to window.open(url) in angular6
- how to remove authorization Bearer in angular 4 post API call
- How to post the Form data using template driven forms using angular 4
- How to pass locale in get service call using angular4
- ERR_CONNECTION_TIMED_OUT
- Called Api Once and used many component in Angular 4?
- Network detection in angular or http client proper error
- Type 'Headers' is not assignable to type 'HttpHeaders | { [header: string]: string | string[]; }'
- How to pass json obj value to API in angular (for post method)
- How to pass the headers separatelyin angular4(when passing json object to API not working)
- Accordion Menu in home page
- How to call/Get the out parameter from an API to Angular4
- How can we get playstore app version in ionic 3 application?
- Variable value is not visible in intercept method- HTTP Interceptors Angular
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?
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)
Here is a working example to get started:
HTML
TypeScript
Controller