tags:

views:

33

answers:

3

Hi,

I am getting this erro when i am trying to upload a video in my site, can u tell me what is the solution for this, why it is coming. Thank you

A: 

The maximum request size is, by default, 4mb (4096 bytes)

This is explained here: http://support.microsoft.com/default.aspx?scid=kb;EN-US;295626

The above article also explains how to fix this issue :)

Dave
+3  A: 

If you are using IIS for hosting your application, then the default upload file size if 4MB. To increase it, please use this below section in your web.config -

<configuration>
    <system.web>
        <httpRuntime maxRequestLength="1048576" />
    </system.web>
</configuration>

Just to add - If you are using IIS7 then you need to use below lines instead of above -

 <system.webServer>
   <security>
      <requestFiltering>
         <requestLimits maxAllowedContentLength="1048576" />
      </requestFiltering>
   </security>
 </system.webServer>
Sachin Shanbhag
Thank you sachin and i added some thing like <httpRuntime maxRequestLength="32768" executionTimeout="180" />
Surya sasidhar
Thank you it is working fine Sachin shanbhag
Surya sasidhar
@Surya- The length is in kbytes. So you can set any size as you want in MaxRequestLength. My example sets the size to 1gb, yours is 32MB
Sachin Shanbhag
At least in IIS7, the MSDN docs state that that maxAllowedContentLength is specified in bytes, not kbytes "Optional uint attribute.Specifies the maximum length of content in a request, in bytes.The default value is 30000000." from http://msdn.microsoft.com/en-us/library/ms689462%28VS.90%29.aspx
Matt Roberts
A: 

There's an element in web.config to configure the max size of the uploaded file:

<httpRuntime 
    maxRequestLength="1048576"
  />

HTH

ema