Home > Mobile >  Mixed Content problem and 413 (Request Entity Too Large)
Mixed Content problem and 413 (Request Entity Too Large)

Time:03-13

I want to upload an image in asp.net MVC, the website is HTTPS and the API is HTTP and occurred below error (I found several questions about this problem but couldn't solve the problem):

Mixed Content The page at was loaded over HTTPS but requested an insecure resource This request has been blocked the content must be served over HTTPS

I add this code to web.config

<httpProtocol>
        <customHeaders>
            <add name="Content-Security-Policy" value="upgrade-insecure-requests" />
        </customHeaders>
    </httpProtocol>

The new error occurred

413 (Request Entity Too Large)

But the size of image is 50 kb

CodePudding user response:

  1. Open IIS
  2. Select the Web Site
  3. Open Configuration Editor
  4. Select system.webServer and expand it, then locate serverRuntime
  5. Change uploadReadAheadSize value to 104857600
  • Related