JavaScript获取FileUpload上传文件的全路径

    //函数功能,获取FileUpload上传文件的全路径
        function getFullPath(obj)
        {
            if(obj)
            {
                //ie
                if (window.navigator.userAgent.indexOf("MSIE")>=1)
                {
                    obj.select();
                    return document.selection.createRange().text;
                }
                //firefox
                else if(window.navigator.userAgent.indexOf("Firefox")>=1)
                {
                    if(obj.files)
                    {
                        return obj.files.item(0).getAsDataURL();
                    }
                    return obj.value;
                }
                return obj.value;
            }
        }

posted @ 2011-08-16 16:58  子夜一梦  阅读(4029)  评论(0编辑  收藏  举报