title: JavaScript file upload is spotty
body: <p>I have some code that uses the HTML input file type to upload XSL to a server-side program. While it works most of the time, once in a while the submit button will return with "The connection was reset," and my server will not have gotten anything (nothing was posted). Here's the code for the file upload, it's pretty standard:</p>
  
  <pre><code>&lt;form action="upload.htm" method="POST" enctype="multipart/form-data" encoding="multipart/form-data"&gt;
  &lt;input type="file" id="datafile" onchange="checkFileType(this.value)" /&gt;&lt;br/&gt;
  &lt;input type="submit" id="datasubmit" value="Send" onclick="submitConfirm()" disabled /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><code>checkFileType</code> will enable and disable the submit button according to filetype, and <code>submitConfirm</code> just hides the form and shows a <code>div</code> containing "Uploading...".</p>
  
  <p>I may be entirely off with this, but I have found that using an XSL file that's larger (60kb) will fail every single time, whereas my original tests with a small file (15kb) worked every time. Is there a size limit to uploading, or is there something I'm missing?</p>
  
  <p>Edit: Also, just to throw it out there, the other case I the file upload to fail consistently with was when I tried to upload non-XSL files (before I implemented the <code>checkFileType</code> function). These non-XSL files were mostly shortcuts, so less than 10kb.</p>