Recent browsers won't let you get at that type of info. file inputs are more restrictive for security.
chris
2010-03-20 04:45:40
Recent browsers won't let you get at that type of info. file inputs are more restrictive for security.
Sites like Facebook, etc, use signed Java applets for this sort of thing (to enable local file reading), and integrate the image upload into that. Technically, you'd be able to pass data between Java and Javascript to prime it for upload, but the whole thing'd be non-trivial :) Check out http://jumploader.com/ for something which might be of use.
Try this:
<script>
function lalala(str){
alert(str);
}
</script>
<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
<input type="file" name="file" id="file" onchange="lalala(this.value);" />
</form>
It worked for me in IE8 it gives me the complete path but in firefox and chrome is just prints the file name :(