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控制元件限制上傳檔案型別控制元件型別
- input file簡單實現限制上傳檔案的型別型別
- input file圖片上傳
- input file美化 --上傳圖片
- input file上傳圖片預覽
- input file multiple 批量上傳檔案
- <input type="file"> 限制檔案型別型別
- 檢測input file檔案是否上傳
- 使用Input type=file 原生上傳使用總結
- HTML5新增的input型別程式碼演示HTML型別
- input[type=file] 獲取上傳檔案的內容
- 如何獲取<input type="file">上傳的檔名稱
- 修改input標籤type=file型別按鈕的值型別
- vue3中清空input type="file"上傳檔案Vue
- JavaScript input type=file 獲取檔案大小及型別限制JavaScript型別
- 將input type="file" 型別的圖片檔案轉成base64型別
- Resumable.js – 基於 HTML5 File API 的檔案上傳JSHTMLAPI
- input file利用FileReader實現圖片上傳程式碼例項
- input型別和限制型別
- 征服number型別的input框型別
- js如何限定圖片上傳的型別JS型別
- input的type值型別和描述-HTML型別HTML
- No input file specified.
- input type="file"使用
- 清空file input框
- jQuery Validate限定上傳檔案的格式型別jQuery型別
- Python判斷上傳檔案型別Python型別
- js實現的判斷上傳圖片的型別JS型別
- jQuery匹配指定type型別input元素jQuery型別
- 如何清除<input type="file">的值
- type=“file”的input標籤美化
- Html5 檔案上傳HTML
- html5檔案上傳HTML
- 表示一個檔案的 File 型別型別
- 【Android】WebView的input上傳照片的相容問題AndroidWebView
- js 讀取 input file 的內容JS