Hello,
My MVC4 project uses an igUpload control for images and videos. With files larger than 10MB the upload will typically stop at some point and I have to cancel.
Obviously there are multiple points where this failure could occur so at this point I am looking for advice about where to start looking for the problem. I have tried different computers in different locations and 10MB seems to be about the largest file that will upload.
I have modified my web.config file to allow uploads up to 100MB (using the maxFileSizeLimit key).
Attached is a screen shot from a failed upload. In the lower left is another upload counter of some kind, I suppose from the browser. The igUpload has stalled at about 75% but the other counter continues (and would get to 100% though this screen shot was taken at 97%). I have no idea what that means!
Thanks for any advice!
Randy
Thank you for your help, Alex!
This gives me what I need to know to handle the error.
Hello Randy,
Normally “onError” event is fired when exception occurs on Server or Client. In the mentioned situation there is no exception thrown until the Server itself does not time out.
One possibility is to monitor the upload status and set JavaScript timeout or counter in uploading event that will cancel the upload after reached time limit.
All upload status and error codes are shown here - http://help.infragistics.com/NetAdvantage/jQuery/2013.1/CLR4.0?page=igUpload_Using_Client_Side_Events.html
You can monitor these with “fileStatus” argument in uploading event.
Hello Alex,
I did figure out how to prevent the timeout during larger uploads, it was by adding this line to the system.web section of my web.config:
<httpRuntime requestValidationMode="4.5" maxRequestLength="102400" executionTimeout="1800" />
In this case, a file size of 100MB is allowed with 30 minutes allowed before the httpException is thrown.
It would still be very useful to be able to trap the timeout when it occurs. Do you have any suggestions about that?
Thank You,
Thank You, Alex.
I will check with my ISP to see if they can help.
In the meantime I would like to ask about trapping the onError event in the igUpload control. When the upload times out I am not able to display an error to the user and end the upload gracefully.
I have the following code to trap the error located in my igUpload initializer:
onError: function (evt, ui) {
var errorString = ui.errorMessage + ' (code=' + ui.errorCode + ', type=' + ui.errorType;
if (ui.ServerMessage != null) { errorString += ' - ' + ui.ServerMessage ; }
errorString += ')';
console.log('video upload error: ' + errorString);
$("#videoUploadError").html(errorString);
},
What happens in my situation is that this code never fires, the fileUploading event just continues to fire with the uploadedBytes total remaining the same. I have attached a screen shot of this.
Eventually, a server side error will be thrown:
System.Web.HttpException (0x80004005): Request timed out.
However, the fileUploading event continues to fire on the igUpload even after that. You can see this in the screen shot as well.
Do you have a suggestion as to how I can trap the onError event and end the upload when it times out?
Normally there should be no reason caused by the control itself that may lead to limit files upload size when it is set correctly in upload settings. The main possibilities for such behavior may be IIS settings or Firewall/Security software that may prevent copying of such files. There may be also some OS related security settings (applied to upload folder or by default) that may prevent copying files with such size. Timeout itself can be caused by slow connection or too many connections made at the same time.
Note that IIS Server by default sets file size limit which can also cause issues when large files are uploaded:
http://es.infragistics.com/community/forums/p/64887/329039.aspx#329039
Check these possibilities and update me with your findings.