title: Why is my upload error message only received by Edge?
body: <p>I use MultipartConfig to handle file upload with a Servlet and send an error message if the file is to large:</p>
  
  <pre><code>       private void doUpload(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
              response.setContentType("text/plain");
              response.setCharacterEncoding("UTF-8");
  
              Part filePart;
              try {
                  filePart = request.getPart("file");
              } catch (IllegalStateException e) {
                  System.out.println("File To Large");
                  response.setStatus(HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE);
                  PrintWriter writer = response.getWriter();
                  writer.println("failure:filetobig");
                  writer.flush();
                  writer.close();
                  return;
              }
           ... (file handling) ...
          }
  </code></pre>
  
  <p>If I use the Servlet with Jquery-File-Upload (Ajax based) and the file-size exceeds maxFileSize, Edge returns the correct error-message with a status code of 413 and a ready-state of 4. If I do the same with Firefox or Chrome I receive a status-code of 0, a ready-state of 0 and the network-tab in dev-tools shows no answer is received.
  <a href="https://i.stack.imgur.com/57eOV.png" rel="nofollow noreferrer">image</a></p>
  
  <p>In Firefox the bitrate switches from negative to positive and Chrome return NaN after a while. No matter which browser I use, the <code>System.out.println("File To Large");</code> is executed. If I execute the Upload-Request with cURL the correct error-message is returned.</p>
  
  <p>My MultipartConfig to test this:</p>
  
  <pre><code>@MultipartConfig(maxFileSize = 1024 * 1024 * 30, // 30 MB
          maxRequestSize = 1024 * 1024 * 1000 // 1000 MB
  )
  </code></pre>