mercredi 29 septembre 2021

QuotaExceededError when saving images in localStorage

I'm trying to figure out a way to cache images in browser memory. I tried saving their base64 representation in local storage as follows:

fr.readAsDataURL(blob)
fr.onloadend = () => {
   const base64 = fr.result
   localStorage.setItem(today.toDateString(), base64)
}

However, I'm getting the following error:

QuotaExceededError: Failed to execute 'setItem' on 'Storage': Setting the value of 'Wed Sep 29 2021' exceeded the quota.

How can I accomplish this?




Aucun commentaire:

Enregistrer un commentaire