//获取file控件路径

来源:互联网 发布:机床主轴结构优化设计 编辑:程序博客网 时间:2024/05/20 17:08
function getFullPath(obj)  
        {  
            if(obj)  
            {  
                if (window.navigator.userAgent.indexOf("MSIE")>=1)    //ie  
                {  
                    obj.select();  
                    return document.selection.createRange().text;  
                }  
                else if(window.navigator.userAgent.indexOf("Firefox")>=1)             //firefox  
                {  
                    if(obj.files)  
                    {  
                        return obj.files.item(0).getAsDataURL();  
                    }  
                    return obj.value;  
                }  
                return obj.value;  
            }  
        }