ASP.NET HttpHandler for x3d / MIME type

496 views Asked by At

I use x3dom to render x3d files. I use the inline loading:

 <inline url="/myfile.x3d" render="true" bboxcenter="0,0,0" bboxsize="-1,-1,-1" load="true" namespacename=""></inline>

With .txt as file extension it works. With .x3d it doesn't. So I added a HttpHandler to my web.config

  <add verb="*" path="*.x3d" type="x3dHandler" />

Without success...

1

There are 1 answers

0
yablokoff On

For future viewers who got the same problem - it may not be only in MIME-type.

If you want to show .x3d simply with url in <inline> tag you may want to add Access-Control-Allow-Origin header with whitelist domain to your host serving .x3d files.

In my case (Django framework instead of ASP.NET) I used https://github.com/ottoyiu/django-cors-headers package and it worked like a charm.