views:

28

answers:

1

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.

A: 

What are you using for your web server? The web server may have a limit on uploaded file size. I know that in IIS + ASP.NET, that limit had to be changed.

Jacob
I'm using a custom web server that was written by a group of other people, but I don't believe they've limited the uploaded file size.
CoV
@CoV custom as in custom `Apache` or are you referring to a very unique and peculiar web-server?
Frankie
@Frankie I'm using a custom as in very unique and peculiar web-server. I haven't had time to delve into the details of the web server, but it doesn't appear to even be getting to the web server at all. Also, I think I have to scratch the file-size thing, as I've just gotten it to load a few times with the larger file.The whole issue is driving me nuts because I can't get a consistent failure, and now I feel bad for making all you guys shoot arrows into the dark...
CoV
@CoV lol... comes with the deal! :) Do try to replicate the error in any way you can. Set up some scripts to run your functions over and over and see if you can find a pattern...
Frankie
Try using Fiddler or Wireshark to capture the HTTP traffic between the web browser and the web server. That may tell us why the server isn't seeing or is rejecting the uploads.
Jacob