日期:2014-05-16  浏览次数:20343 次

谷歌浏览器上传标签的问题
<!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盘的某个目录(貌似定死的样子) 求解决方案

------解决方案--------------------
参考下吧

http://topic.csdn.net/u/20120608/17/7f99251e-e395-41d9-b39e-a2b23e2b1ebd.html



兼容最好用flash
------解决方案--------------------
谷歌浏览器已经无法取到文件的真实路径了,除非用flash
------解决方案--------------------
,chrome是上传图片的,firefox给序列化成base64了

看csdn的js就知道了,http://passport.csdn.net/Scripts/ImagePreview.js
JScript code

ImagePreview.MODE = $$B.ie7 || $$B.ie8 ? "filter" :
    $$B.firefox ? "domfile" :
    $$B.opera || $$B.chrome || $$B.safari ? "remote" : "simple";