ReactiveDict stringifies (and hence destroys) my array of Files


#1

I’ve got a file upload div where users can drag/drop files to be uploaded (via edgee:slingshot). I’m storing the list of files in a ReactiveDict. The problem is, ReactiveDict runs EJSON.stringify on all values passed to it, and stringifying File basically destroys it, creating an empty object.

Now, I can easily convert File to a plain JS object easily enough, and then store that. But when it comes time to fetch that value and JSON.parse it, I’m left with a plain object which edgee:slingshot doesn’t want. I need some way to convert the plain object back into a File object. Is this possible?


#2

A temporary workaround was to just not store the list of file objects in a ReactiveDict, and just make a global, making it reactive via Tracker.Dependency.