HTML5的input:file上傳型別控制
轉自:http://www.haorooms.com/post/input_file_leixing
一、input:file屬性
屬性值有以下幾個比較常用:
accept:表示可以選擇的檔案MIME型別,多個MIME型別用英文逗號分開,常用的MIME型別見下表。
multiple:是否可以選擇多個檔案,多個檔案時其value值為第一個檔案的虛擬路徑。
1、accept
只能選擇png和gif圖片
<input id="fileId1" type="file" accept="image/png,image/gif" name="file" />
2、multiple
多檔案上傳
<input id="fileId2" type="file" multiple="multiple" name="file" />
3、常用MIME型別
字尾名 MIME名稱
*.3gpp audio/3gpp, video/3gpp
*.ac3 audio/ac3
*.asf allpication/vnd.ms-asf
*.au audio/basic
*.css text/css
*.csv text/csv
*.doc application/msword
*.dot application/msword
*.dtd application/xml-dtd
*.dwg image/vnd.dwg
*.dxf image/vnd.dxf
*.gif image/gif
*.htm text/html
*.html text/html
*.jp2 image/jp2
*.jpe image/jpeg
*.jpeg image/jpeg
*.jpg image/jpeg
*.js text/javascript, application/javascript
*.json application/json
*.mp2 audio/mpeg, video/mpeg
*.mp3 audio/mpeg
*.mp4 audio/mp4, video/mp4
*.mpeg video/mpeg
*.mpg video/mpeg
*.mpp application/vnd.ms-project
*.ogg application/ogg, audio/ogg
*.pdf application/pdf
*.png image/png
*.pot application/vnd.ms-powerpoint
*.pps application/vnd.ms-powerpoint
*.ppt application/vnd.ms-powerpoint
*.rtf application/rtf, text/rtf
*.svf image/vnd.svf
*.tif image/tiff
*.tiff image/tiff
*.txt text/plain
*.wdb application/vnd.ms-works
*.wps application/vnd.ms-works
*.xhtml application/xhtml+xml
*.xlc application/vnd.ms-excel
*.xlm application/vnd.ms-excel
*.
相關文章
- HTML5的 input:file上傳以及型別控制HTML型別
- input file圖片上傳
- input file multiple 批量上傳檔案
- <input type="file"> 限制檔案型別型別
- 使用Input type=file 原生上傳使用總結
- input[type=file] 獲取上傳檔案的內容
- 修改input標籤type=file型別按鈕的值型別
- vue3中清空input type="file"上傳檔案Vue
- input type="file"使用
- No input file specified.
- input的type值型別和描述-HTML型別HTML
- 表示一個檔案的 File 型別型別
- jQuery匹配指定type型別input元素jQuery型別
- js 讀取 input file 的內容JS
- 一文搞懂 $_POST 和 file_get_contents ("PHP://input") 的區別PHP
- HTML input file 檔案域HTML
- HTML input file檔案域HTML
- HTML5拖拽檔案上傳HTML
- input file相容性問題
- 頁面報錯 No input file specified
- HTML5的新特性——語義化標籤、多媒體標籤(video、audio)、input型別、表單屬性HTMLIDE型別
- jsp頁面判斷檔案上傳型別JS型別
- 記:痛苦的排錯之” No input file specified.“
- no input file specified 三種解決方法
- angular input 為file on-change 無效Angular
- Laravel file 上傳檔案資訊獲取Laravel
- laravel file上傳檔案資訊獲取Laravel
- 關於 Go 中 Map 型別和 Slice 型別的傳遞Go型別
- 檔案上傳漏洞防範-檔案型別檢測型別
- Web 伺服器顯示 no input file specifiedWeb伺服器
- <input type="file"> 選中多個檔案
- 專案遷移 寶塔 No input file specified
- 網站開啟提示:”No input file specifed.“網站
- 使用url()後出現No input file specified.
- uniapp uview 上傳圖片,資料以formData + File 形式傳輸APPViewORM
- ASP.NET MVC使用input標籤上傳檔案ASP.NETMVC
- python 傳送buffer型別資料, 傳送octet-stream型別資料, 傳送Uint8Array型別資料Python型別UI
- 【SQL】Oracle建立CLOB型別上傳下載讀取檔案SQLOracle型別
- 處理input file限制只能拍照不能選相簿