File upload above 30 MB is not working in angular application hosted in azure

Praveenkumar K 1 Reputation point
2021-07-23T13:10:49.86+00:00

I have tried to upload file above 30 MB till 100 MB but none of the files are uploading in angular application. Angular application hosted in Azure and below configuration files are used in code

in web.config inside configuration tag below settings are added

   <configuration>  
       <system.web>  
           <!-- maxRequestLength for asp.net, in KB (100 * 1024) -->   
          <httpRuntime maxRequestLength="102400" ></httpRuntime> -- in kilo bytes  
       </system.web>  
         
       <system.webServer>  
          <security>  
              <requestFiltering>  
                 <!-- This will handle requests up to 100MB (100 * 1024 * 1024)-->  
                    <requestLimits maxAllowedContentLength="104857600" /> --- in bytes  
               </requestFiltering>  
          </security>  
       </system.webServer>  
   </configuration>  

Configured 100 MB upload limit in both tag which has verified one of the blog says that both value should be matched so that 102400 KB and 104857600 bytes have referred 100 MB.

Whenever upload any files above 30MB till 100 MB the error says CORS Error. As per my understanding azure accepts all request..

117409-azure-error.png

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,934 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. brtrach-MSFT 17,731 Reputation points Microsoft Employee Moderator
    2021-07-27T04:47:19.69+00:00

    @PraveenKumar-2914 Thank you for the question.

    Updating the web.config file was the correct action to take so it's strange that you're still receiving a CORS error.

    Have you tried rebooting the web app to see if that might help force the web.config file to take effect?

    If that does not work, please let us know and we will continue the investigation on our end. We look forward to your reply.

    0 comments No comments

  2. Praveenkumar K 1 Reputation point
    2021-08-04T07:10:29.67+00:00

    Hi,

    Its done and working as expected.. The issue was changing web.config file in angular application instead backend web.config.. So again changed web.config in backend along with adding additional changes in CORS menu (like given value as "*") which has been specified in UI app service.. After done all changes restarting the application and worked as expected and upload 100 MB as well through angular application..


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.