往数据库上传excel表怎样通过js获取文件全路径
function getFullPath(){
var filepath = getPath(document.getElementById("file"));
alert(filepath);
//var filepath=getPath(obj);
function getPath(obj)
{
if(obj)
{
//ie
if (window.navigator.userAgent.indexOf("MSIE")>=1)
{
obj.select();
alert(document.selection.createRange().text);
return document.selection.createRange().text;
}
//firefox
else if(window.navigator.userAgent.indexOf("Firefox")>=1)
{
if(obj.files)
{
alert(obj.files.item(0).getAsDataURL());
return obj.files.item(0).getAsDataURL();
}
alert(obj.value);
return obj.value;
}
return obj.value;
}
//alert(filepath);
}
window.location.href="examiner/excelToDB.action?filepath="+filepath;
}
往数据库上传excel表怎样通过js获取文件全路径