I am using the mvc helper method to create the file upload control. What I need it to do is submit the file when I submit the form. I have turned off automatic upload but when I click the submit button on the form. No files are posted to the controller. Is there any documentation that you can point me to or any examples?
Thanks in adavnace,
Gary Cryer
Hello Gary,
Please feel free to contact me if you have any questions regarding this matter.
In this scenario I would suggest using the button to invoke just the upload for igUpload, and handling the fileUploaded event in order to initiate the form submit:
<form id="form1" runat="server"> <script type="text/javascript" > $(window).load(function () { $("#igUpload1").igUpload({ autostartupload: false, progressUrl: "/IGUploadStatusHandler.ashx", fileUploaded: function () { document.forms[0].submit(); } }); }); </script> <div id="igUpload1"> </div> <input type="button" value="submit and upload" onclick="$('#igUpload1').igUpload('startUpload',0)" /> </form>
Please feel free to contact me if you have any questions.