zip
firefox: application/octet-stream
chrome: application/octet-stream
oprea: application/zip
IE: application/x-zip-compressed
firefox: application/octet-stream
chrome: application/octet-stream
oprea: application/zip
IE: application/x-zip-compressed
rar
firefox: application/x-rar-compressed
chrome: application/octet-stream
oprea: application/x-rar-compressed
IE: application/octet-stream
使用Struts2上传文件,其实使用的是apache的commons-fileupload-1.1.jar.
<interceptor-ref name="defaultStack">
<!-- 配置允许上传的文件类型 -->
<param name="fileUpload.allowedTypes">application/msword,application/pdf,application/zip</param>
<!-- 配置允许上传的文件大小 -->
<param name="fileUpload.maximumSize">10485760</param>
</interceptor-ref>