Filereader - upload same file again not working

后端 未结 4 572
灰色年华
灰色年华 2020-12-03 10:02

I have sth like drawing app. User can save projects and then load them. When I load first time one file (for e.g. project1.leds) make some changes in the app but no saving i

4条回答
  •  甜味超标
    2020-12-03 10:37

    because input is caching the same file value so when you load the same file again it uses the cache to read value property. all you need to do is set a conditional statement when you use input element and set the value property of input to an empty string and it should work

    input.value = "";
    

    and if you are using an event handler then

    e.target.value = "";
    

提交回复
热议问题