PWA. Offline saving and retrieving images in and from user's phone local system?

178 Views Asked by At

I'm currently developing a PWA which would need to store images taken from the user's phone camera in a persistent way, and then call to those same images for populating a page (in the same way a normal website would do communicating with the server) but without leaving user's phone context.

Saving the images in the server is not contemplated, as the amount of images and users would do it very storage consuming. I've been studying the use of File System API, as any normal web could do it, but having to ask for permission constantly make it extremely uncomfortable.

I was expecting that in the development of a PWA running on local device would be a way to bypass some of the restrictions that communicating with the server'page through a browser have.

I've been trying to save images as blobs in a .txt for later use with no success. In the end that's not really the workaround I would like to use, because of the need for asking permission every time I want to save the .txt, the impossibility of updating the same .txt instead of saving different versions, the lack of control about where to storage this .txt and finally, the need of asking for permission to read this .txt when opening the page.

Saving the blobs picture information in local db as indexedDB would be a possibility, but I would try to not doing it this way, because of the need of using the storage capacity of indexedDB for saving other resources. In addition, the fact of how easy is to accidentally clear needed PWA's data from indexedDB simply clearing cache makes me feel really uncomfortable and dependent of a constant backup system.

Can anyone tell me an offline way of storing pictures and retrieving them from phone user's local system (Android, IOS and more)? A lot of thanks for your time.

0

There are 0 best solutions below