如何找到"mime-type(Content-Type?)"文件?在Windows上 [英] How can I find out a files “mime-type(Content-Type?)”? on Windows

查看:220
本文介绍了如何找到"mime-type(Content-Type?)"文件?在Windows上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以在Windows Batch/PowerShell中找出文件的MIME类型(或称为内容类型" ...)?

Is there a way to find out the MIME-TYPE (or is it called "Content-Type"...) of a file in windows batch/PowerShell?

推荐答案

使用来自源文件或您可以从此处获取win32二进制文件

空文件中的示例:

COPY NUL >test.ext && "C:\Program Files (x86)\GnuWin32\bin\file" −-mime-type test.ext

哪个会返回:

test.ext; text/plain

更新:

-b--brief也不在输出行前添加文件名

Also -b or --brief do not prepend filenames to output lines

file -b −-mime-type test.ext仅返回mime类型:text/plain

file -b −-mime-type test.ext return only the mime-type: text/plain

输入file --help以获得更多选项

注意:源代码比GnuWin32友好提供给我们的可执行文件要新得多.

这篇关于如何找到"mime-type(Content-Type?)"文件?在Windows上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆