Hi Team
I'm facing issues in igUpload.
I'm uploading a file more than maxFileSize ( Eg : 100KB), after that upload controller gets disabled. i can't able to upload the file.
How to upload a file after that error. Kindly help me out.
Thank You
Karthikeyan Rajakumar
$(function () { $("#igUpload1").igUpload({ mode: 'single', autostartupload: true, progressUrl: "http://igniteui.com/IGUploadStatusHandler.ashx", controlId: "serverID1", maxFileSize: 100000, errorMessageAJAXRequestFileSize: "File must be smaller than 100 KB.", errorMessageMaxFileSizeExceeded: "File must be smaller than 100 KB.", errorMessageCancelUpload : "Upload Cancelled", onError: function (e, args) { debugger; showAlert(args); } }); function showAlert(args) { $("#error-message").html(args.errorMessage).stop(true, true).fadeIn(500).delay(3000).fadeOut(500); } });
Hello Karthikeyan,
I suspect that this behavior is caused by the maxFileSize option. What I can suggest is that you make the server-side validation of the file size by using the "maxFileSizeLimit" application setting in the web.config file like this:
<appSettings>
<add key="maxFileSizeLimit" value="4194304" />
</appSettings>
See the "igUpload Overview" topic for details.
Best regards,Martin PavlovInfragistics, Inc.
Hi martin,
Thank you for your reply. I fixed the issues by this code .
$(function () { $("#igUpload1").igUpload({ autostartupload: true, fileUploading: function (evt, ui) { alert("fileUploading..."); alert(ui.totalSize); if (ui.totalSize > 100000) { $("#error-message").html("File size exceeds 100 KB").stop(true, true).fadeIn(500).delay(3000).fadeOut(500); return false; } else return true; } }); });