获取上传文件浏览器路径


var file = document.getElementById("file").files[0];
function getObjectURL(file){
var url = null ;
if (window.createObjectURL!=undefined) { // basic
url = window.createObjectURL(file) ;
} else if (window.URL!=undefined) { // mozilla(firefox)
url = window.URL.createObjectURL(file) ;
} else if (window.webkitURL!=undefined) { // webkit or chrome
url = window.webkitURL.createObjectURL(file) ;
}
return url ;
}
原文地址:https://www.cnblogs.com/jj0219/p/10410359.html