码迷,mamicode.com
首页 > Web开发 > 详细

获取上传文件浏览器路径

时间:2019-02-21 09:42:23      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:get   document   rom   lse   cti   def   obj   pre   文件浏览器   


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 ;
}

获取上传文件浏览器路径

标签:get   document   rom   lse   cti   def   obj   pre   文件浏览器   

原文地址:https://www.cnblogs.com/jj0219/p/10410359.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!