Category:Web-HTML5/CSS3
Article From:https://www.cnblogs.com/lonelyxmas/p/9125263.html
Original: input:file upload type control of HTML5

HTML5Input:file upload type control

201490820 visits in August 29th of the year

One, input:file attribute

The attribute values are commonly used as follows:

accept:Represents the type of file MIME that can be selected. Multiple MIME types are separated by English commas. The commonly used MIME types are shown in the following table.

multiple:If you can select multiple files, the value value of multiple files is the virtual path of the first file.

1、accept

Only PNG and GIF pictures can be selected

<input id="fileId1" type="file" accept="image/png,image/gif" name="file" />

2、multiple

Multi file upload

<input id="fileId2" type="file" multiple="multiple" name="file" />

3、Common MIME types

Suffix name       MIMEName
*.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-

Leave a Reply

Your email address will not be published. Required fields are marked *