Reputation: 9091
My situation is this: I want to have a pop-up box open from your browser via JavaScript then I want the pop-up box to display all removable devices it can see attached to your computer, then you will be able to select and write to one etc.
Upvotes: 2
Views: 2038
Reputation: 34592
Javascript is confined to the browser level, and hence cannot read/write to files, let alone get a list of removable drives...The restrictions are there for a reason...
Imagine if there was no restrictions, a javascript code behind a web page could do very very malicious things to your system such as removing vital system files, easily infect a machine without the user ever knowing about, the whole thing on browsing would be killed instantly and have loads of zombie computers operating a big massive bot spamming/hacking/breeding ground for viruses/malware...unpleasant scenario...
That is why Javascript is so restricted in terms of security and confined to only what the browser can display/render. No File I/O, System I/O etc..
Hope this helps, Best regards, Tom.
Upvotes: 1
Reputation: 8364
I'm not pretty sure (I'm a newbie) but I think you can do that only with AJAX interaction. JavaScript itself only works on client side, without access to the computer itself.
I found this searching on google:
But seems like a bit... lacking, since it onlu works on Windows, and it doesn't do too much.
Upvotes: -1
Reputation: 944202
The APIs made available to JavaScript by web browsers do not include any ability to access the user's filesystem (in a standard security context)
Upvotes: 2