Unable to load .fbx or .gltf file, while .stl file is working with no issue

I have 3 files to be loaded into the scene (.stl, .fbx, .gltf). All these files are located in the same directory.
I am facing no issue while loading .stl, but for .fbx and .gltf I get the error 404.
Not sure whats causing the issue, as file name and path seems correct. I even tried reading .txt file from the same directory with no issues whatsoever.

Also I am using the appropriate loaders for loading these files. (FBXLoader and GLTFLoader). the application is hosted locally as of now.
Cant figure out what causing this issue. any lead on this would be of great help.

The issue is with your code and you didn’t share that code (at least the part responsible for loading stuff) - how to help :smiling_face_with_tear:

All loaders work exactly the same - make sure the loaded paths are correct (ex. copy and paste in the browser search bar, without editing it any way whatsoever - if the file downloads after you press enter, then it’s correct, if it doesn’t, then is not correct.)

I did try opening the urls in the browser. stl files does get downloaded… but fbx file give 404 page not found. even though its present at the same location as stl file. (verified it almost 100 times now). additioned I verified by using different fbx files too from the internet.

Btw, my threejs code is hosted in asp.net project

If you opened the url in chrome and it shown 404 - the FBX is not there, your server doesn’t see it, or has wrong paths, that’s it. The issue is not with three / JS code in that case, but with your assets server. Make sure opening https://localhost/path/to/you/file.fbx downloads that FBX when you paste https://localhost/path/to/you/file.fbx into the searchbar. Only afterwards get back to coding the JS part - JS code is not the issue right now.

You’re most likely trying to fetch the STL from another location, since it’s getting served properly.

1 Like

Hi,

Please share the code or console screenshots?

@mjurczyk … The file location and namings are all correct. seems like its a file permission issue. need to handle it in the backend. Thanks for the Help.