Reputation: 181
I have successfully stored a base64 image to the local storage.
I have tried and failed in adding the stored value to an input file field.
document.getElementsByName("inputfieldname")[0].setAttribute("value", getSavedValue("thesavedkey"));
<input type="file" name="inputfieldname">
Upvotes: 0
Views: 37
Reputation: 13827
document.getElementById('mytext').value = = window.sessionStorage.getItem('user')
try above one.
Upvotes: 1
Reputation: 2044
you can't set a value in this way to a file
type input due to legacy security vulnerabilities.
Upvotes: 2