【发布时间】:2010-12-05 15:15:30
【问题描述】:
我正在创建一个仅上传 zip 文件的脚本,并且我已经完成了以下验证:
if($itemtype != "application/x-zip-compressed"
&& $itemtype != "application/zip" && $itemtype != "application/octet-stream") {
throw new exception("Your file should be a zip file!");
}
但我有一个文件类型为 application/force-download 的文件,但是当我查看 mime 类型时我找不到它,我是否仍将其添加到验证中(参见上面的代码)?我尝试上传的文件应该是一个普通的 zip 文件……嗯,这就是我的想法
【问题讨论】:
标签: php scripting zip mime-types