Mulesoft Developer
Mulesoft Developer

Reputation: 2824

File upload size issue in asp.net

I am getting error on file upload in asp.net and the file size is 780kb but it is uploading 147 bytes successfully enter code here

i did set this in web.config file but still getting error any idea why?

<system.web>
    <compilation debug="true" targetFramework="4.0" />
    <httpRuntime  maxRequestLength="1000000" executionTimeout="360"/>
    <!--<httpRuntime maxRequestLength="10000" requestValidationMode="2.0" executionTimeout="360"/>-->
  </system.web>

Upvotes: 1

Views: 1401

Answers (3)

ankit rajput
ankit rajput

Reputation: 182

Write the code as follows in web.config:

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

Upvotes: 0

Alexei Levenkov
Alexei Levenkov

Reputation: 100630

There could be another web.config on AdminPanel level that overrides the site level setting.

Another option: upload could be done with Base64 encoding that makes data about 1.4 times bigger than file size (+ headers of the request). Make sure to set restriction accordingly.

Upvotes: 0

Mike
Mike

Reputation: 1974

It doesn't appear to be related to the file size - you would get a different error code. HTTP 400 usually indicates some problem in the request header. Do a Fiddler capture of the transaction to see what is actually being sent.

Upvotes: 2

Related Questions