清空:
在前台写个脚本--
<script type="text/javascript" language="javascript">
function show() {
document.getElementById("FileUpExcel").outerHTML = "<input name=FileUpExcel type=file>";
}
</script>
在后台需要清空的地方,写上---
Response.Write("<script language=javascript>show()</script>"); //清空FileUpExcel
过滤文件类型:
在前台写个脚本-----
<input id="FileUpExcel" type="file" runat="server" style="width: 350px" οnchange="javascript:if(this.value.toLowerCase().indexOf('需要上传的文件类型')==-1){alert('Please import the Excel file!');location.reload();}" />