MIME Type Wavefront OBJ and MTL

I was creating a small 3D application using threeJS and WebGL. I intentionally decided not to convert the models into .json files compatible with ThreeJS, instead I started to create an importer. It works, but I also planned for the application to decide which type of model was loaded using both the file extension and the MIME type, later if the first is unknown.

I read somewhere that the MIME type should be application/wavefront-obj , which would be strange since there is also a model tree, but anyway. Although browsing the IANA website for this type of file gives no results.

Did I miss something?

+6
source share
4 answers

According to wikipedia , this is " text / plain " for .obj.

I assume that it is " text / plain " for .mtl files, since there is text in them and because it "is the standard defined by Wavefront Technologies for ASCII files ."

+5
source

You need to update the web.config file and add a link to the obj file type

 <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <staticContent> <remove fileExtension=".obj" /> <mimeMap fileExtension=".obj" mimeType="text/plain" /> </staticContent> </system.webServer> </configuration> 
+1
source

I was surprised to see in the IANA database for wave wave obj files, given that they had been kicking on the Internet for at least 20 years. I would be happy to work with others to create an official MIME type.

Until then, in accordance with Section 3.3 of RFC 6838 , β€œPersonal Tree or Vanity,” you can use your own media type, something like text/prs.wavefront-obj , in addition to text/plain . This way you can use the HTTP Accept header to negotiate the appropriate MIME type in your response.

0
source

Use the "application / object" MIME type for .obj files. It works in Chrome, Safari and FireFox.

0
source

Source: https://habr.com/ru/post/953260/


All Articles