I want to check a file exist in folder. Below code is while i\'m trying to many times is not working.
This wont work because your browser does not have access to your file system.
you can run this from a node.js server
see https://en.wikipedia.org/wiki/JavaScript#Security