Upload large files to Web API with Javascript

We can upload large files to a REST Web API with JavaScript using FormData. Below JavaScript code snippet uploads the file selected using a standard HTML file input tag. Update the maxAllowedContentLength in web.config as per the requirement. The below snippet shows the maxAllowedContentLength set to accept upto 2GB of data. Below code snippet is…

This configuration section cannot be used at this path

In ASP.NET web.config, when you want to use a configuration which is locked at a parent level in a machine/server, you need to explicitly unlock it to use web.config for your site. Typical error would be like, “This configuration section cannot be used at this path. This happens when the section is locked at a parent…