开发者

Check whether a directory exists or not using JavaScript [closed]

开发者 https://www.devze.com 2023-04-06 13:58 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rh开发者_开发技巧etorical andcannot be reasonably answered in its current form.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rh开发者_开发技巧etorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

How to check whether a directory or folder exists or not using javascript or jquery?


You can't. If Javascript had access to the file system (either client or server), it would be a security hole.


Do you mean Javascript running in the browser and checking a directory in the user's machine? If so, you'll have a very hard time doing this, as the browser is isolated from the computer's file system for security reasons.

It can't be done.

Good thing too -- if it could be done, there would be any number of malicious hackers using it to find out what software you've got installed, etc. (occasionally the hackers to manage to find a way through the sandbox and do manage to get at the file system, but these holes generally get closed by the browser vendors very quickly)


JavaScript cannot access the local filesystem.

0

精彩评论

暂无评论...
验证码 换一张
取 消