怎么看一个<input type="file">浏览的单机路径?
高洛峰
高洛峰 2016-10-31 10:31:38
0
1
651

我一点 hi 按钮,弹出的是 :

1.png

可我的路径明明是 Z:金字塔数据minute1PP01_50000~59999@129310.txt

可能 <input type="file"> 本身就是这样,能不能用别的 标签代替 <input type="file"> 呢?

比如 用js 做一个事件 function ,直接弹出一个浏览框 ,并且把 选中的文件保存到一个 div 标签里..

<body>

    <input type="file" id = "filename" name="file" accept="image gif" />
    <button id="an">hi</button>

</body>

<script>

    $(function(){

        $("#an").on("click",showInfo);


        function showInfo()
        {
            alert( $("#filename").val() );
        }

    })


</script>


高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!