0

I want user to select an PNG/JPEG image file from his computer, and everytime he opens the webpage, I want image to be available. A few image files can be saved, total of 250MB.

I've seen solution to save the base64 data url to local storage, but

I suspect max storage limit for local storage is 5MB What is the max size of localStorage values? . So that wouldn't work.

I've also seen a solution to automatically load files from disk: https://stackoverflow.com/a/61705781/3994249. But it requires user prompt, which is a nuisance.

I suspect IndexedDB might be a solution, but I am unsure if this is a good practice. I don't want to overkill by uploading the images into a backend. What other options do I have.

eguneys
  • 6,028
  • 7
  • 31
  • 63
  • Yes, IndexedDB would be the right approach *if* you have to save it on the client (which is somewhat odd) – CertainPerformance Mar 23 '22 at 01:53
  • I am looking for a natural approach, and also simplest. I am ok with a server side solution, if it means using a simple plugin api or a easy library I can host. – eguneys Mar 23 '22 at 01:57

0 Answers0