ics文件的mime类型 [英] ics file mime type
问题描述
我正在尝试将ics文件上传到我的网站.它是从Mac OSX上的iCal导出的.我以为ics文件的mime类型为text/calendar
,但是由于某种原因,该文件似乎是Application/octet-stream
类型.这使上传无法通过我的验证测试.任何人都有任何想法,为什么类型不是我期望的?!
I'm trying to upload an ics file to my site. It was exported from iCal on Mac OSX. I thought that ics files had a mime type of text/calendar
, but for some reason this file seems to be of type Application/octet-stream
. This makes the upload fail my verification tests. Anyone have any ideas why the type isn't what I expect?!
推荐答案
MIME类型是由浏览器确定的,看来您的浏览器不知道ics文件的正确MIME类型.没关系,只需跳过MIME检查并进行一些结构分析(是否存在有效的标头,是否存在任何日历记录,等等)
The MIME type is determined by the browser, and seemingly, your browser doesn't know the proper MIME type for an ics file. Never mind, just skip the MIME check and do some structural analysis (Is there a valid header, are any calendar records present, etc.)
无论如何,MIME类型用于验证的用途非常有限,因为它可以由客户端自由修改.
The MIME type is of very limited use for validation anyway, as it can be freely modified by the client.
这篇关于ics文件的mime类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!