Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File size upload limit in Orchard CMS Media

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!

like image 714
Stefan Filip Avatar asked Aug 31 '11 08:08

Stefan Filip


2 Answers

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.

like image 70
Piotr Szmyd Avatar answered Oct 24 '22 17:10

Piotr Szmyd


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.

like image 41
SeeTrai Avatar answered Oct 24 '22 17:10

SeeTrai