I did a website to view 3d models and would like to have a option to download them, the download itself is working, however I'm struggeling to include the gltf file itself and have no idea how to do it.
This is the code so far, in the end the zip contains a gltf file, but it contains only the path to the file, not the file itself.
async function downloadModel(id) {
const model = await this.fetchModel(id);
var JSZip = require("jszip");
var zip = new JSZip();
zip.file("README.txt", "Text\nText");
zip.file(model.name + ".gltf", model.file);
zip.folder("textures");
zip.generateAsync({ type: "blob" }).then(function (content) {
saveAs(content, model.name + ".zip");
});
}