<script type="text/javascript">
$(function() {
$("input[name='image']").change(function() {
var formData = new FormData($( "#myform" )[0]);
$.ajax({
url: 'SaveServlet',
type: 'POST',
data: formData,
async: false,
cache: false,
contentType: false,
processData: false,
success: function (returndata) {
alert(returndata.key);
},
error: function (returndata) {
alert(returndata);
}
});
});
});
</script>