Save glb export result in a File rather than download

Hi, I have a question about saving the scene (not download the scene).

Currently, I’m using

GLTF2Export.GLBAsync(viewer.sceneManager.scene, "scene").then(
                (glb) => {
                  glb.downloadFiles();
                }
              );

I want to save the (glb) results into the file (not download it.)
Like , I tried
var file = new File([glb], "filename.glb");
But , It’s giving me 15Bytes file size. You can say it’s not proper file that I’m looking for. Because , when I used glb.downloads() , It’s giving me 9.4MB file size.

Please help me in this regard.

glb is an object that can contain multiple files, they’re located in glb.glTFFiles

1 Like

Hi,
I found a best solution for it
var file = new File([glb.glTFFiles["scene.glb"]], "export.glb");
Worked… heheheh

2 Likes

Thanks , I consoled it and found :smiley:

is there any playground example ? i can’t make it worked.