2011-07-31 20 views

Respuesta

2

Sí, se puede establecer en el web.config

Sólo tienes que configurar en el web.config en la sección <system.web>. En el siguiente ejemplo yo pongo la maximum length a 2GB

<httpRuntime maxRequestLength="2097152" executionTimeout="600" /> 

Tenga en cuenta que el maxRequestLength se encuentra en KB's y se puede configurar hasta 2 GB (2079152 KB's). Pero el límite de tamaño de archivo predeterminado es (4MB).

3

Puede establecer la propiedad del maxRequestLength web.config en código como este:

Configuration webConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~"); 
var section = (System.Web.Configuration.SystemWebSectionGroup)webConfig.GetSectionGroup("system.web"); 
section.HttpRuntime.MaxRequestLength = 10 * 1024; // 10 MB 
webConfig.Save(); 

Hacemos this exact thing en nuestro sistema de gestión de contenido de Rock RMS.

Cuestiones relacionadas