Display icon for mime type in MCV3 razor page

Is there a quick way to determine (and display) the icon in use for a particular user, and display it on an MVC3 page?

eg

All my users will be on Win (XP/Vista/7) and I will restrict mime types for uploaded files to: "text/plain" (for csv), "application/pdf", "application/msword" and "application/vnd.openxmlformats-officedocument.wordprocessingml.document"

However, it would be "nice" if the icon displayed to the user matched the application they use to view the files.

Is this possible?


This relies on what would be a security hole: The ability for javascript to identify installed software on a persons computer. That said, it may be possible to new ActiveXObject and identify whether some apps are installed by identifying if assemblies are registered in this way. Otherwise you're best bet is to go with chances: If they're using windows display excel, if mac display it's icon, if android display whatever, etc

I would really just go with a best guess, you'll be right the vast majority of the time I'd wager. It's just a major loss in ROI to get any more accurate than basing it off of their detected OS considering the amount of work anything beyond that would take.

链接地址: http://www.djcxy.com/p/45538.html

上一篇: 未知的mimetype MFMailComposerViewController

下一篇: 在MCV3剃须刀页面中显示MIME类型的图标