<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function show(){
alert(document.getElementById("test").value);
}
</script>
</head><body>
<input type="file" name="file1" onchange="show()" id="test"/>
</body>
</html>
发现不论上传的文件的位置在哪里,都显示的是c盘的某个目录(貌似定死的样子) 求解决方案

解决方案 »

  1.   

    参考下吧http://topic.csdn.net/u/20120608/17/7f99251e-e395-41d9-b39e-a2b23e2b1ebd.html兼容最好用flash
      

  2.   

    谷歌浏览器已经无法取到文件的真实路径了,除非用flash
      

  3.   

    但是csdn可以上传图片  说明是能得到正确路径的   他是怎么做到的啊 ??头疼
      

  4.   

    ,chrome是上传图片的,firefox给序列化成base64了看csdn的js就知道了,http://passport.csdn.net/Scripts/ImagePreview.jsImagePreview.MODE = $$B.ie7 || $$B.ie8 ? "filter" :
    $$B.firefox ? "domfile" :
    $$B.opera || $$B.chrome || $$B.safari ? "remote" : "simple";