var file1= document.getElementById("file1").value;
// 判断浏览器类型,防止浏览器将文件路径设为C:/fakepath/
var isIE = (document.all) ? true : false;
var isIE7 = isIE && (navigator.userAgent.indexOf('MSIE 7.0') != -1);
var isIE8 = isIE && (navigator.userAgent.indexOf('MSIE 8.0') != -1);
if(isIE7 || isIE8)
{
var file = document.getElementById("file1");
file.select();
file1= document.selection.createRange().text;
document.selection.empty();
}