javascript check if file exists locally