How do I get IE6 to take ContentType seriously?

别来无恙 提交于 2020-01-05 04:25:35

问题


I'm fighting with a third-party ActiveX control that we are using to load TIFF images into the client browser from an ASP.Net(3.5) web form. The ActiveX control registers itself correctly (as far as I can tell) as the MIME handler for TIFF images and works correctly every time a file is double-clicked locally. However, IE6 and the ActiveX control behave differently depending on a few situations that I've been able to identify so far.

EDIT The ActiveX control is not actually in the web page at all (no tag). The client will have the ActiveX control installed, and by streaming the raw image to the client, the ActiveX control spawns in the browser automatically based on MIME handling. END EDIT

For background purposes, we are streaming the image to the browser using Response.BinaryWrite(buffer) where buffer is a byte array containing the binary image. I've tried using Response.TransmitFile() and a couple of other methods in the web form as well. The web servers are running Server 2003 SE SP2, website is running under IIS6.

  • If I set Response.ContentType = "image/tiff" before streaming, the ActiveX control fails to load in IE6.
  • If I specify the name of the image, or for that matter, ".tif" anywhere in the query string, the ActiveX control loads successfully in IE6.
  • If I use FireFox, everything works perfectly (insert wry "IE6 sucks" cliché here).

I've done a whole slew of research on the registry settings that IE6 uses to determine MIME handling, and have even tried disabling MIME sniffing/MIME handling on the client, all to no avail. I don't mind specifying ".tif" in the query string, but even this does not load the control successfully on a Citrix client, which hollers "Registry!" at me.

Oh, one other thing; it's a requirement that the ActiveX control load without prompting the user, so adding a Content-Disposition header with "attachment; filename=yaddayaddayadda.tif" is not a possibility.

Has anyone encountered anything like this before? How did you overcome it, if you did? Is there a global fix I can push to the client desktops? Is there something I need to set on the web server? I feel like I've tried everything.

Thanks in advance.


回答1:


It's unclear from your question exactly what's going on. Is the ActiveX control on the ASPX page or does it make a request to the ASPX page? Are you using an ASPX to serve binary TIFF data?



来源:https://stackoverflow.com/questions/1532905/how-do-i-get-ie6-to-take-contenttype-seriously

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!