Hey guys,
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:
<form action="upload.htm" method="POST" enctype="multipart/form-data" encoding="multipart/form-data">
<input type="file" id="datafile" onchange="checkFileType(this.value)" /><br/>
<input type="submit" id="datasubmit" value="Send" onclick="submitConfirm()" disabled />
</form>
checkFileType
will enable and disable the submit button according to filetype, and submitConfirm
just hides the form and shows a div
containing "Uploading...".
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?
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 checkFileType
function). These non-XSL files were mostly shortcuts, so less than 10kb.