I'm trying to upload and store Profile image in local storage (for one demo purpose) using jquery. I just did upload part and don't know how to store that image in local storage. Please check this fiddle and help me to sort this out. Thanks.
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function(e) {
$('#bannerImg').attr('src', reader.result);
}
reader.readAsDataURL(input.files[0]);
}
}
$(".file-upload").change(function() {
readURL(this);
});
$(".upload-button").on('click', function() {
$(".file-upload").click();
});