Below is the code that i tried to local storage the file state which i had selected but after refreshing it is not present.How to do it using local Storage?
<html>
<head>
<script>
function savedata(){
localStorage.SetItem("file",getElementById("store").value);
}
window.onload = function(){
document.getElementById("store").value = localStorage.getItem("file");
}
</script>
</head>
<body>
<form>
<input type ="file" id = "store" onchange="savedata();"/>
</form>
</body>
</html>
when i am uploading a file it is showing as somefilename.png/jpg.But after i refreshed the page it is showing No file choosen.I want the last selected filename which I have been selected even after refresh.
Even after I refresh the page it should show the previous file name instead of no file choosen how to do that?
after I have refreshed the file it is showing no file choosen