views:

74

answers:

4

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.

Is this possible? I'm pretty new to JavaScript sorry if its a silly question.

+1  A: 

See if this will help you.

Anton Gogolev
+2  A: 

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)

David Dorward
A: 

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.

Oscar Carballal
Ajax would only work if you wanted access to the disks on the server, not the client, and simply linking to the filesystem won't identify the drives that the OP is looking for.
David Dorward
+1  A: 

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.

tommieb75
Thanks Guys, i found that with Javascipt it is possible with some rules bent like you say the easiest way to open a file dialog box is in the html <input type="file"> which gives you an upload file dialog, but i dont think i was clear enough i would like a FOLDER dialog box but its very hard to do which is a shame :(Thanks again Guys!
Ash