<input type="file" accept="XXXX" >
accept表示可以上传文件类型,XXXX是支持的格式。
accept中的文件类型:
常用的office类型 | 格式 |
---|---|
application/pdf | |
*.doc | application/msword |
*.docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
*.xls | application/vnd.ms-excel |
*.xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
*.ppt | application/vnd.ms-powerpoint |
*.pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation |