Basically I have a form which inside it I have File input, now I want to know how to send the choosen file to server using jquery ajax and how to receive the sent file in java EE
<div class="browsephoto_div">
<form class="image" method="POST">
    <label class="takeapicture_btn">
        <input type="file" accept=".png, .gif, .jpeg, .jpg" id="imagetoupload" onchange="loadFile(event)" required/>
        <span>Browse</span>
    </label>
</form>
</div>
<script>
var loadFile = function(event) {
var output = document.getElementById('imagetoupload');
alert(output.value);
};
</script>
 
     
    