Retrieve an image from the server, store it in localStorage, and display it

后端 未结 4 635
终归单人心
终归单人心 2021-02-01 10:12

This should be simple enough, but after wrestling with it for hours, I still can\'t get it to work. So far, all my attempts have resulted in the image becoming \'corrupted or tr

4条回答
  •  礼貌的吻别
    2021-02-01 10:56

    Browsers have size limitations other than the localStorage limit of 5MB. The data for the is also restricted and is usually much less than 5MB. The easiest way around this is to just pass the file-names via localStorage and let the browsers caching do the work.

提交回复
热议问题