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

218
Views
CORS missing allow origin for downloading file and putting into zip with jszip

I have this code:

function create_zip() {
    var zip = new JSZip();
var count = 0;
var zipFilename = "zipFilename.zip";
var urls = [
  
  'Link to full file url'
];

urls.forEach(function(url){
  var filename = "filename";
  // loading a file and add it in a zip file
  JSZipUtils.getBinaryContent(url, function (err, data) {
     if(err) {
        throw err; // or handle the error
     }
     zip.file(filename, data, {binary:true});
     count++;
     if (count == urls.length) {
       zip.generateAsync({type:'blob'}).then(function(content) {
          saveAs(content, zipFilename);
       });
    }
  });
});
}

with this html:

<input id="button" type="button" onclick="create_zip()" value="Create Zip"></input>

And I keep running into an error saying CORS missing allow origin How would I fix this issue? thanks

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can try with this CORS permissions. It's working for me:

[
    {
        "AllowedHeaders": [],
        "AllowedMethods": [
            "GET"
        ],
        "AllowedOrigins": [
            "your URL"
        ],
        "ExposeHeaders": []
    }
]
about 4 years ago · Juan Pablo Isaza Report
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!