jimmywarting / StreamSaver.js

StreamSaver writes stream to the filesystem directly asynchronous
https://jimmywarting.github.io/StreamSaver.js/example.html
MIT License
3.97k stars 413 forks source link

download many seperate files simultaneously #251

Closed yaotusa closed 6 months ago

yaotusa commented 2 years ago

hi jimmy

when i try to execute the following code in chrome 96

const downloadFile = async function (url, name) {
  const response = await fetch(url)
  let fileStream = streamSaver.createWriteStream(name)
  await response.body.pipeTo(fileStream)
  console.log('download successfully')
}

downloadFile("https://***", "name1")
downloadFile("https://***", "name2")
downloadFile("https://***", "name3")

following error occurs

Uncaught TypeError: Cannot read properties of null (reading 'remove') at MessagePort.channel.port1.onmessage (StreamSaver.js?3717:219) channel.port1.onmessage @ StreamSaver.js?3717:219

how can i download many seperate files simultaneously please help me; hope for your answer;