I have an beego application in which i have a requirement of uploading a image from client for to server location.
//Till now I have tried the following script
$("#fileupload").on("click",function(){
$("#my_file").click();
userImage = document.getElementById('fileupload');
imgData = getBase64Image(userImage);
localStorage.setItem("imgData", imgData);
});
<!--Html where i have kept option for image upload-->
<ul>
<li style="margin-top:5px;"> .Hii vijay </li>
<li><input type="file" id="my_file" style="display: none;" /></li>
<li><img id="fileupload" name="filetoupload" src="../../static/img/img.png"></li>
</ul>
using this script, when i click on empty image(click here to add) it is displaying a browse file option.After selecting the image no action taking place. My requirement is on selection of image from browse option, the selected image should be saved in server location.