Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
807 views
in Technique[技术] by (71.8m points)

javascript - Three.js Loading .OBJ error in Azure but not Locally

I am using three.js for webGL to load .obj but I have a problem when loading .obj in Windows Azure runnning Windows Server 2008 I using Google chrome browser and it gives the error below:

GET http://websiteaddress.net/webGL/obj/test.mtl 404 (Not Found)

even, I used their original source code to load .obj file it has the same error

and when i try to navigate other images file in the server i can preview it eg: (website.net/images/test.gif) - i can see the test.gif image in the browser

but when i navigate to .obj, i receive error in the browser: (eg : website.net/obg/test.obj)

404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

i can view my .obj locally but not when I put it in Azure! can anyone helps me? Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

[SOLVED] LOADING .OBJ (Wavefront) FILE IN WINDOWS HOSTING RETURN 404 ERROR [SOLVED]

As I was Working with Three.js and loading a .obj file works great for me in localhost but when running the files from the Windows Hosting it return 404 for the .obj file.

So, we need to add this lines to the web.config file of the project root folder (if you don't have the file in your project root folder then go ahead and create one. )

web.config

        <?xml version="1.0" encoding="UTF-8"?>
        <configuration>
            <system.webServer>
                 <staticContent>
                        <mimeMap fileExtension=".obj" mimeType="application/octet-stream" />
                 </staticContent>
            </system.webServer>
        </configuration>

Place the web.config to correct location and Enjoy :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...