Skip to content

Commit

Permalink
Merge pull request #5807 from david-poindexter/issue-5778
Browse files Browse the repository at this point in the history
Update `web.config` max upload size defaults, correct backend calcs, and fix validation issue preventing increasing
  • Loading branch information
valadas authored Sep 8, 2023
2 parents 40b2bf5 + c4f8c39 commit 7c9c29f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DNN Platform/Tests/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
<forms name=".DOTNETNUKE" protection="All" timeout="60" cookieless="UseCookies" />
</authentication>
<!-- allow large file uploads -->
<httpRuntime shutdownTimeout="120" executionTimeout="900" useFullyQualifiedRedirectUrl="true" maxRequestLength="12288" requestLengthDiskThreshold="12288" />
<httpRuntime shutdownTimeout="120" executionTimeout="900" useFullyQualifiedRedirectUrl="true" maxRequestLength="28672" requestLengthDiskThreshold="81920" />
<httpCookies httpOnlyCookies="true" requireSSL="false" domain="" />
<!-- GLOBALIZATION
This section sets the globalization settings of the application.
Expand Down
7 changes: 6 additions & 1 deletion DNN Platform/Website/development.config
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@
<add name="X-Frame-Options" value="SAMEORIGIN" />
</customHeaders>
</httpProtocol>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="29360128" />
</requestFiltering>
</security>
</system.webServer>

<system.web>
Expand Down Expand Up @@ -149,7 +154,7 @@
</authentication>
-->
<!-- allow large file uploads -->
<httpRuntime targetFramework="4.7.2" shutdownTimeout="120" executionTimeout="1200" useFullyQualifiedRedirectUrl="true" maxRequestLength="29296" requestLengthDiskThreshold="81920" maxUrlLength="2048" requestPathInvalidCharacters="&lt;,&gt;,*,%,:,\,?" enableVersionHeader="false" requestValidationMode="2.0" fcnMode="Single" />
<httpRuntime targetFramework="4.7.2" shutdownTimeout="120" executionTimeout="1200" useFullyQualifiedRedirectUrl="true" maxRequestLength="28672" requestLengthDiskThreshold="81920" maxUrlLength="2048" requestPathInvalidCharacters="&lt;,&gt;,*,%,:,\,?" enableVersionHeader="false" requestValidationMode="2.0" fcnMode="Single" />
<httpCookies httpOnlyCookies="true" requireSSL="false" domain=""/>
<!-- GLOBALIZATION
This section sets the globalization settings of the application.
Expand Down
7 changes: 6 additions & 1 deletion DNN Platform/Website/release.config
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@
<add name="X-Frame-Options" value="SAMEORIGIN" />
</customHeaders>
</httpProtocol>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="29360128" />
</requestFiltering>
</security>
</system.webServer>

<system.web>
Expand Down Expand Up @@ -150,7 +155,7 @@
</authentication>
-->
<!-- allow large file uploads -->
<httpRuntime targetFramework="4.7.2" shutdownTimeout="120" executionTimeout="1200" useFullyQualifiedRedirectUrl="true" maxRequestLength="29296" requestLengthDiskThreshold="81920" maxUrlLength="2048" requestPathInvalidCharacters="&lt;,&gt;,*,%,:,\,?" enableVersionHeader="false" requestValidationMode="2.0" fcnMode="Single" />
<httpRuntime targetFramework="4.7.2" shutdownTimeout="120" executionTimeout="1200" useFullyQualifiedRedirectUrl="true" maxRequestLength="28672" requestLengthDiskThreshold="81920" maxUrlLength="2048" requestPathInvalidCharacters="&lt;,&gt;,*,%,:,\,?" enableVersionHeader="false" requestValidationMode="2.0" fcnMode="Single" />
<httpCookies httpOnlyCookies="true" requireSSL="false" domain=""/>
<!-- GLOBALIZATION
This section sets the globalization settings of the application.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,8 @@ public HttpResponseMessage GetOtherSettings()
Host.RememberCheckbox,
Host.AutoAccountUnlockDuration,
Host.AsyncTimeout,
MaxUploadSize = Config.GetMaxUploadSize() / (1024 * 1024),
RangeUploadSize = Config.GetRequestFilterSize(),
MaxUploadSize = Config.GetMaxUploadSize() / 1024 / 1024,
RangeUploadSize = 4294967295 / 1024 / 1024, // 4GB (max allowedContentLength supported in IIS7)
AllowedExtensionWhitelist = Host.AllowedExtensionWhitelist.ToStorageString(),
DefaultEndUserExtensionWhitelist = Host.DefaultEndUserExtensionWhitelist.ToStorageString(),
},
Expand Down

0 comments on commit 7c9c29f

Please sign in to comment.