A
A
askold20132019-02-15 14:50:09
JavaScript
askold2013, 2019-02-15 14:50:09

How to save an object with functions and files in the browser (localStorage, etc..)?

There is an array with a complex structure of nested objects/arrays. Object values ​​can be a function or a File. The question is - how can this whole thing be parsed and saved in the browser and then restored?
LocalStorage is not the only option. IndexedDb, and any browser solutions will work too. You need to somehow save the function and the file.
Please, is there any solution for this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2019-02-15
@sergiks

The function is not allowed, because it is not serialized. See Algorithm for structured cloning
File - easily: in BLob it and in IndexedDB.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question