Read/Write Files on the Client Side

I am writing an app for mainly my personal use, that fetches word meanings from Webster’s REST api, & then sends it to client (Web/Android/iOS). I am using native Android/iOS.

Now over a course of time, I’ve decided on sending the huge amount of data in json files from server to the respective client. So I have thought of not using DDP or discontinue it.

Kindly advice me on this.

Now there are proven ways of getting files on the client. However, I am not able to find a way of accessing files on the client. I have been unable to find ways of reading & modifying files stored on the client. On the web browser that is. Coz it’s very easy to read/write files on native Android/iOS.

Should I use FileReader API for the web browser. Is it easy to do so on Meteor Clients?? Are there any packages for doing this. Once the file has been downloaded to Desktop/Client windows machine, how do you open it in the browser, & read it? There are many packages of inputting & uploading the file from client side. Can we use them to access the contents of the file.

What about Veliov/Meteor-Files?

I have to only present the data in the form of a detailed word-list across many pages. I presumed sending loads of data is better with json files, saved at the client for use. Coz it’s good for offline experience.

Client side databases are not so good, bcoz they might even loose data over a period of long durations.

I might be misunderstanding your requirements. However, in general, you don’t “send” files to clients, the client requests them from you - you can do this using the fetch API in most browsers.

If these files are very large, you can employ a service worker to cache them, or rely on the browsers own internal caching. However, if you plan on using them in JS code anyway, it might be worth fetching and inserting into an IndexedDB collection in the browser

Many, many thanks to you.

Indeed it’s a big, big help.

So what happens, as I said earlier, when due to very large data in IndexedDB some of the data starts vanishing from it. How do we track vanishing data. If the DB starts reaching its limits it starts getting rid of data that is not used often. And the vanishing data is also not very predictable.

Secondly, the chief question was, how do we access data in the files fetched from server. FileReader API? Any other options? I know I can also get data in the client as an object by default. But that’s not gonna be ok for such huge amount of data. I mean what if I get really hooked on to this app, and the data & my list of words just keeps getting bigger and bigger?

What if I have to modify the files fetched from server? Is it possible. How do I write-to/modify files fetched from the server?