How to use:
- dataType: 'json',
- success: function (data, status)
- /* show success message */
- error: function (data, status, e)
- /* handle error */
Very similar to Jquery Ajax syntax, isn’t it? pass the server URL i.e. servlet URL and elementId i.e. value of id attribute of “file” input.
Where to get it? download from here
Generate a form at runtime and post the file using
- form.enctype = 'multipart/form-data';
Generally form submit is attached with the document object and form submit refreshes the main document. This plugin also generates an iframe and form submit event is attached to that iframe, so main page doesn’t get refreshed at the time of form submit.