I'm trying to make a multi-step form using HTML5 and javascript. What I'm trying to do is for each step, save form data to localStorage and then at the final step, retrieve the data back from localStorage and assign those data to hidden fields. For text data I have no problem doing that but for file input, I cannot save it to localStorage after file input field has been stringtified. I did some more research and came up with constructing a Blob object and then attach that Blob to a hidden file input but people say for security reasons, that is not possible. Any ideas on how I can do this or a different solution? I'm new to this.
Here's what I've tried:
$(document).on("click", ":submit", function(e) {
var fileData = ($($file).val())
var stringtified = JSON.stringify(fileData);
localStorage.setItem('savedFile', stringtified);
});