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刪除。