views:

64

answers:

2

I need user to select file on his computer and get only location of that file (not to upload). Any suggestions?

Thanks,
Ile

+1  A: 

You can use javascript with ActivxObject to get file detail of client machine

see the following article might help you Using JavaScript to read a client-side file

Pranay Rana
This would only work on Internet Explorer.
SiN
yes this will only work with ie but there is no other way
Pranay Rana
how about usage of flash? is it possible to do it with usage of flash?
ile
yes you can do it with flash but have no idea about because i am not falsh devloper
Pranay Rana
A: 

you could create a <file ...> input and when the user clicks the submit button, read the value of the input and then remove it from the DOM before the form is submitted.

I'm not sure if there's a better way.

Chad
That won't work. The value of the file input is not accessible from javascript for security reasons.
Marnix van Valen
ah, wasn't aware of that. Thanks for the info. Is this consistent across browsers?
Chad
I need to correct my previous comment. It's not possible to SET the value of a file input. It is however possible to read the value. So you solution should work. However most browsers will however return only the file name, not the full path. I tried this in Chrome, FF and IE8. Only IE8 returns the full path.
Marnix van Valen