input="file" 瀏覽時只顯示指定excel文件,篩選特定文件類型


<p>顯示 .xls, .xlsx, .csv 文件...</p>
<input type="file" accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" ID="fileSelect" runat="server" />  




<p>只顯示  Excel (.xlsx) 文件...</p>
<input type="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ID="fileSelect" runat="server" />  


<p>只顯示 Excel (.xls) 文件...</p>
<input type="file" accept="application/vnd.ms-excel" ID="fileSelect" runat="server" />  




<p>只顯示圖片.</p>
<input type="file" accept="image/*" ID="fileSelect" runat="server" />  




<p>只顯示文本文件...</p>
<input type="file" accept="text/plain" ID="fileSelect" runat="server" />  


<p>只顯示html文件.</p>
<input type="file" accept="text/html" ID="fileSelect" runat="server" />  


<p>只顯示 video 文件..</p>
<input type="file" accept="video/*" ID="fileSelect" runat="server" />  


<p>只顯示 audio 文件...</p>
<input type="file" accept="audio/*" ID="fileSelect" runat="server" />  


<p>只顯示 .WAV 文件...</p>
<input type="file" accept=".wav" ID="fileSelect" runat="server" />  


<p>只顯示 .PDF 文件...</p>
<input type="file" accept=".pdf" ID="fileSelect" runat="server" />   

 

轉載來源:CSDN 原文:https://blog.csdn.net/DosMing/article/details/77891560?utm_source=copy 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM