"500 internal server error" on file upload using ajaxrequest

2 answers
Thread Answer
Kubilay
In my project I can upload photo files by ajax request.
But while I can upload some of the files, some files can't be uploaded and ajax reuqest returns "500 internal server error" .
What could be the reason for this ?
Kubilay
It solved.
Thanks for your answer.
You saved my day.
Osman
It is hard to realize problems like that.
You need to increase max Json Length in web.config as;

<system.web.extensions>
    <scripting>
      <webServices>
        <jsonSerialization maxJsonLength="50000000"/>
      </webServices>
    </scripting>
  </system.web.extensions>