使用Apache TIka验证文件的内容各类型时,经常遇到一些文件类型不知道具体的content-type是什么,这里列出常见的文件类型和对应的Content-type,以供参考。
文件扩展名 | Tika的文件类型 |
application/pdf | |
zip | application/zip |
docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
doc | application/msword |
xls | application/vnd.ms-excel |
xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation |
ppt | application/vnd.ms-powerpoint |
jpg | image/jpeg |
PNG | image/png |
bmp | image/bmp |
gif | image/gif |
mp4 | video/mp4 |
csv | text/csv |
txt | text/plain |
xml | application/xml |
json | application/json |
html | text/html |
mp4a | audio/mp4 |
mpga | audio/mpeg |
mp3 | audio/mpeg |