Load file from URL that doesn't contain file name (Firebase project)

Hi guys. I have somewhat weird problem. I am working on the Babylon project, and I am using Firebase platform.

I need to load a file from the link like bellow. But If I use this link Babylon loader doesn’t know what to load. Even if you go to this link you will get file without extension. So of course, I created a server, I get this URL and write the file with the proper name and extension and then I can use that newly written file to load into Babylon. Which is great. Idea was that whatever the URL is, I create temporary file, load it, edit it, save data into database and delete the file.

But the problem is that Firebase sets whole project as a read-only. And I cannot write files there. So this whole idea doesn’t work.

Is there any other idea how this could be done? Is there a way to somehow store data on the server and send it to client (like Blob, base64, some streams or whatever, I am not very familiar with this stuff)

https://storage.googleapis.com/mergecube-preflight/ObjectViewer%2FObjects%2FP4P8Q2?GoogleAccessId=firebase-adminsdk-vkc1c%40mergecube.iam.gserviceaccount.com&Expires=2524608000&Signature=EZjnPjNpq%2BuAB3avehtG3GJskzkEK05bNSSxNMQD8bhUk25n4dBmd7ih%2F1%2BjZYq1yJ%2FjMlZF1AwqbH1YwDfzW%2FyVSVh3YFvmcJHHgB1cx9yHvlwCckwMUFZcQNqLaCc0yvzXW%2Fpi%2BuQCHtJPJP7cnywI2A%2Fw5VesJ1uZVtGOwlTLKEBHBYMZppImZ6pbGuxAeWPJ5OhTLUxmPBjJW7AMgT4Xs%2F8v7i1ly%2BckEz%2B0o1POpJcrDq6dGYx5cURBZ%2BVGjdTiBQnp%2BJQp4auWY4Yd%2BYtbXkkPgQ1BlpaVb%2FRUyDV%2BE%2FLXfT5CBAERLSt792MtOxpsq36yW3HGT0I%2BGe1lcQ%3D%3D

Thank you

Also I need to add… I am using assetManager, and that’s how I am loading the file (I can change the approach tho). But as I understand when getting the file Babylon loading functions are creating xmlhttprequest. Is there a way to set headers for this request, or I need to create my own request to make that work.

When loading an assets you can set the plugin extension to load it, for example:

https://playground.babylonjs.com/#UKNERM#210

In your case, the issue is that the .obj file has fixed URLs for the .mtl and the texture assets (as you can see in the example). If you use .glb (for example) you can get everything included in one single file, and then there is no reason it won’t work.

Plugin extension enabled me to load these links directly now. That solves my problem for now. Thank you so much for your answer.

1 Like