File size upload limit in Orchard CMS Media
Asked Answered
C

3

10

I'm using the Media module to upload a file in Orchard. If I select a file of 2.2MB it works, however if I try to upload a bigger file (let's say a 4MB movie) I get an error page saying that 'This page is not available'.

Is there a size limit and if yes how can I increase it?

Thanks!

Chariot answered 31/8, 2011 at 8:29 Comment(0)
T
16

You can set that in root Orchard Web.config file (it's in the Orchard.Web project if you are working with the full source). By default ASP.NET has a 4MB limit for size of POST request.

<system.web>
   <httpRuntime  maxRequestLength="1024000" executionTimeout="360"/>
</system.web> 

Above will set max request size to 1 GB. You can read more about that here, here and here.

Tricornered answered 31/8, 2011 at 10:9 Comment(2)
Also, in IIS7 you'll need to set the following under system.webServer: <security> <requestFiltering> <requestLimits maxAllowedContentLength="31457280"></requestLimits> </requestFiltering> </security>Barabarabarabas
This worked for me. Before adding this setting I could not load a 20Meg byte msi file. This setting worked.Ardeliaardelis
E
3

An additional note to Piotr's answer: maxRequestLength's value is in KBs, so maxRequestLength should be 1024000 for a GB (the answer above shows 102MB).

For those using Azure and the ClickToBuildAzurePackage.cmd from the source: You'll need to modify the src\Orchard.Azure\Orchard.Azure.Web\Web.config file with maxRequestLength. This is because the packager will overwrite the Web.config in the src/Orchard.Web/Web.config with this file. Or technically you can make the build and modify the web.config file after and repackage, but I personally haven't gotten Azure to successfully take my "rezipped" package.

Expel answered 22/5, 2012 at 21:56 Comment(1)
Was missing a 0 (so it was actually 102MB) - thanks for finding out. Corrected my answer accordingly.Tricornered
R
0

When uploading large files to Orchard via http over ADSL, another setting that I needed to change was the connection timeout, which has a default of 120 seconds. This seems to override the settings discussed here and caused the connection to be reset. In IIS7 this is under the 'Limits...' section on the right hand side, for the specific site node, or 'set Web Site Defaults...' on the sites node. The config section is:

<system.applicationHost>
   <sites>
      <siteDefaults>
         <limits connectionTimeout="00:20:00" />
      </siteDefaults>
   </sites>
</system.applicationHost>

See also iis.net documentation

Reverential answered 12/3, 2013 at 13:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.