AjaxSubmit () submits the file, ajaxsubmitfile
I have checked various methods on the Internet before. If you want to submit a file, you must be able to receive the returned values. We recommend that you use the ajaxSubmit () method.
Most of the recommendations on the Internet are:
$ ("# FormId "). submit ($ (this ). ajaxSubmit ({url :..., type :..., success: function (){...}}); return false; // prevents automatic submission );
However, when using this method, you will find that there will be multiple submissions, one request for the first time, and two requests for the second time .....
The ajaxSubmit () itself has the submit () function, so you don't need to do this, just use:
Var opt = {type: 'post', datatype: 'json', url :'.. /.. /.. /rybmanagement/upLoadFile ', success: function (data ){...}}; $ ("# formId "). ajaxSubmit (opt); // equivalent to from. submit ()
Import file:
<Script src = "jquery-form.js" type = "text/javascript"> </script> <script src = ".../js/jquery-2.1.1.min.js"> </script>
The above is an example of how AjaxSubmit () submits a file. I hope it will help you. If you have any questions, please leave a message and I will reply to you in time. Thank you very much for your support for the help House website!