Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

195
Views
Save a file from the internet in a zipfile with jszip

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");
  });
}
about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!