开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜