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

99
Views
function multi-downloading for array of files

It is necessary to make a function that the file loader is called from the code. That is, a list of paths is passed and the browser starts downloading them. Example 1: downloadFiles([ "/1.jpg", "/2.jpg", "/3.jpg" ])

the function itself is in the outline (though only for one file)

function donwloadFiles(url, sourceElement) {
    disableOnUnloadPage = true;
    var a = document.createElement("a");
    a.href = url;

    if (sourceElement) {
        a.target = sourceElement.target;
    }

    dojo.body().appendChild(a);
    a.click();
    disableOnUnloadPage = false;
}

If you run several files at once like this, they are not downloaded. The browser has some internal logic that does not allow this to be done.

How to remove SourceElement and make it accept an array of links as in example 1.

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

0

You can't.

Browsers do not let webpages spawn multiple windows or downloads.

It would be too abusable.

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!