mime是一个互联网标准,通过设定它就可以设定文件在浏览器的打开方式。
mime使用方法:
- 使用mime模块查询文件的MIME类型:
mime.getType('/path/to/file.txt'); // => 'text/plain' mime.getType('file.txt'); // => 'text/plain' mime.getType('.TXT'); // => 'text/plain' mime.getType('htm'); // => 'text/html'
mime是一个互联网标准,通过设定它就可以设定文件在浏览器的打开方式。
mime.getType('/path/to/file.txt'); // => 'text/plain' mime.getType('file.txt'); // => 'text/plain' mime.getType('.TXT'); // => 'text/plain' mime.getType('htm'); // => 'text/html'
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。