title: Connection keeps getting reset when trying to upload file to tomcat server
body: <p>I am trying to create a website where people can post stuff. Currently, I am trying to make it such that users can add files sequentially and send it as a multi-part request in ajax.However, I keep getting connection reset error in chrome when I am trying to upload files. I have to log back into the server in order to see the new files.</p>
  
  <p>HTML code:</p>
  
  <pre><code>&lt;form id="postForm" method="post" enctype="multipart/form-data"&gt;
                          &lt;textarea name="text" rows="4" cols="" class="form-control" placeholder="What's Up" id="postTextarea"&gt;&lt;/textarea&gt;
                          &lt;div class="radio"&gt;
                              &lt;label&gt;&lt;input type="radio" name="privacy" value="restricted" checked&gt;Restricted&lt;/label&gt;
                              &lt;label class="checkbox-inline"&gt;&lt;input type="checkbox" name="group" value="family" class="group"&gt;Family&lt;/label&gt;
                              &lt;label class="checkbox-inline"&gt;&lt;input type="checkbox" name="group" value="bestie" class="group"&gt;Besties&lt;/label&gt;
                              &lt;label class="checkbox-inline"&gt;&lt;input type="checkbox" name="group" value="friend" class="group"&gt;Friends&lt;/label&gt;
                          &lt;/div&gt;
                          &lt;div class="radio"&gt;
                              &lt;label&gt;&lt;input type="radio" name="privacy" value="public"&gt;Public&lt;/label&gt;
                          &lt;/div&gt;
                          &lt;br&gt;
                          &lt;div id="fileContainer"&gt;
  
                          &lt;/div&gt;
                          &lt;div id="buttonContainer"&gt;
                              &lt;label class="btn btn-default" id="fileUploadButton"&gt;
                                  Add Files&lt;input type="file" name="file" class="fileInput" hidden multiple&gt;
                              &lt;/label&gt;
                              &lt;button class="btn btn-primary" id="postButton"&gt;Post&lt;/button&gt;
                          &lt;/div&gt;
                      &lt;/form&gt;
  </code></pre>
  
  <p>JavaScript:</p>
  
  <pre><code>var submittedFileData = [] ;
  $('.fileInput').on('change', function () {
          var files = $(this).prop('files') ;
          for (var i = 0; i &lt; files.length; i++) {
              var p = document.createElement("p") ;
              $(p).text(files[i].name + " (Click here to remove file)") ;
              $(p).addClass("filename") ;
              $("#fileContainer").append(p) ;
              submittedFileData.push(files[i]);
          }
      });
  $('#postButton').click(function () {
          var privacy = $( "input[type=radio][name=privacy]:checked" ).val();
          var formData = new FormData();
          //append privacy
          formData.append("privacy" , privacy) ;
          //append groups
          $( "input[type=checkbox][name=group]:checked" ).each(function(i) {
              formData.append("group" , $(this).val()) ;
          }) ;
          //append text
          formData.append("text" , $("#postTextarea").val()) ;
          //append files
          for (var i = 0; i &lt; submittedFileData.length; i++) {
              formData.append("file" , submittedFileData[i]) ;
          }
          $.ajax({
              type: "POST",
              url: "post-upload",
              data: formData,
              processData: false,
              contentType: false,
              cache: false,
              async : false,
              success: function (data) {
              },
              error: function (jqXHR, textStatus, errorThrown) {
                 alert(errorThrown) ;
              }
          });
          $.post("feed-view","relation="+activeTab ,getXMLResponse) ;
      });
  </code></pre>
  
  <p>server.xml for tomcat 9</p>
  
  <pre><code>&lt;Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
  sslImplementationName="org.apache.tomcat.util.net.jsse.JSSEImplementation"
             maxThreads="150" SSLEnabled="true"
              scheme="https"
         secure="true" maxPostSize="-1" disableUploadTimeout="false" connectionUploadTimeout="600000"&gt;
      &lt;SSLHostConfig&gt;
          &lt;Certificate certificateKeystoreFile="C:/Users/Kathavarayan/.keystore"
              certificateKeystorePassword=""
                       type="RSA" /&gt;
      &lt;/SSLHostConfig&gt;
  &lt;/Connector&gt;
  </code></pre>