javascript check if file path exists