0

I would like to specify when downloading files the path or location where my files will be stored and not the default location. How should I do it?

function CreateFolder(fldr)
{
  var path = fso.BuildPath("/home/wfbjzar/", fldr);

  if (! fso.FolderExists(path))
    fso.CreateFolder(path);
}

downloadBtn.addEventListener('click', () => {
  const downloadLink = document.getElementById('downloadLink');
  const children = Array.from(outputDiv.children)
  let str = ''
  console.log(fileInput.files)
  children.forEach((i, index) => {
      // str += `\n` + i.innerText

      const url = new Blob([i.innerText], { type: 'text/plain' })
      const file = new Blob([url], { type: 'text/plain' });
      downloadLink.href = URL.createObjectURL(file);
      downloadLink.download = fileInput.files[index].name;
      downloadLink.click();
      setTimeout(function(){
                    window.location.href = 'index.html';
                 }, 1500);
  });

});
Brian Tompsett - 汤莱恩
  • 5,438
  • 68
  • 55
  • 126
RORO
  • 1

0 Answers0