Jeremy Dicaire
Jeremy Dicaire

Reputation: 4905

Detect USB key/drive using PHP (client side installation)

first of all, I want to be clear on this point, the PHP script will run on the client side (not server side, I know it's impossible!).

How can PHP detect USB key/USB drive when it is plugged on the USB port?

Or, how can it detest USB when running the command (not at the time we plug it on the computer) if it's more possible...

It's under windows. Under MAC should be good too but I really need that for Windows.

Any idea ? using a command prompt and analysing retrieved informations (ignoring cd/dvd drive then let the user choose)

Don't know if I'm enought clear here but give your idea and let me know if you have any questions.

Thank you

Upvotes: 3

Views: 1990

Answers (1)

FtDRbwLXw6
FtDRbwLXw6

Reputation: 28929

You could try a combination of one of the exec() family of functions with whatever command-line utility Windows has for viewing currently attached devices(fsutil, fsinfo, fdisk?).

Upvotes: 1

Related Questions