Meteor approach to Cordova-App with lots of photos

I am building an application in which users can post photos that they take with the device’ camera into chat rooms (like whatsapp with lots of photos).

For certain users there can be several thousands photos that they need access to - also when offline. I am using FSCollection and GroundDB. I tried several strategies but still wonder what is the best approach? For example:

1) Store images directly in documents: Save images as base64 directly into the database and persist with GroundDB. For the first prototype this was a convenient approach but this is probably not a good approach for several reasons.

2) Use FSCollection with cfs:filesystem. I am not sure how good this one will scale as localstorage (GroundDB) is probably limited (depending on device)?

3) Use Cordova local fileSystem: When creating the photo with device’s camera, save them first locally to the filesystem (cordova.file.dataDirectory) using cordova’s fileTransfer and use FSCollection to upload the data. Then with a helper check if file is available offline and if yes display it from there and if not use the file object from FSCollection and download the file to the local filesystem.

However I experienced that this approach get quite complex and I encountered several problems, e.g. because you need to use a local webserver to access the files from the local filesystem (cf. How to access local files in cordova? )

Am I missing something? What would be a good strategy for such a situation?

3 Likes

So, how did you decide to do it?

I would really like to hear how this was implemented in the end.

what we did - stored it on cloudinary
check it out https://app.orangry.com/

Hello friend, any breakthrough?