How to save an image to localStorage and display it on the next page?

后端 未结 7 2210
逝去的感伤
逝去的感伤 2020-11-22 07:31

So, basically, I need to upload a single image, save it to localStorage, then display it on the next page.

Currently, I have my HTML file upload:

<         


        
7条回答
  •  闹比i
    闹比i (楼主)
    2020-11-22 07:51

    I have come up with the same issue, instead of storing images, that eventually overflow the local storage, you can just store the path to the image. something like:

    let imagen = ev.target.getAttribute('src');
    arrayImagenes.push(imagen);
    

提交回复
热议问题