首页 > 代码库 > input type file 获得用户选择的一般方法

input type file 获得用户选择的一般方法

<script type="text/javascript">    function ShowExcelFile() {        var tempName = $("#selectOriginFile_CertificationTemplateSelect").val();        if (tempName != null && tempName != "") {            window.open("/home/ReadExcelFile?filename=" + encode(tempName), excel文件显示, height=768, width=1024,fullscreen=no, scrollbars=auto);        }    }</script><div style="width:100%;height:100%; text-align:center; padding-top:300px;">     请选择原始数据文件:     <br />        <input type="file" id="selectOriginFile_CertificationTemplateSelect"  title="选择" />    <br />    <h1>显示选择的文件</h1>    <input type="button" value=http://www.mamicode.com/"显示" onclick="ShowExcelFile() " /></div>